Giter Club home page Giter Club logo

Comments (4)

BorisMoore avatar BorisMoore commented on July 18, 2024

Thanks Johan. Here is an update which should fix that issue:

jsViews11a.zip

The change is line 5517 and 5512:

while (deferChar = deferPath.charAt(j--)) {
	// Use the "+" and"-" characters to navigate the path back to the original parent node where the deferred bindings ocurred
	if (deferChar === "+") {
		if (deferPath.charAt(j) === "-") {
			j--;
			targetParent = targetParent.previousElementSibling; // IE9 or later only
		} else {
			targetParent = targetParent.parentNode;
		}
	} else {
		targetParent = targetParent.lastElementChild; // IE9 or later only
	}

But <IE9 did not support those APIs. I guess at this point we can remove support for IE8 without concern.... Otherwise we would need to add a polyfill, or equivalent...

Let me know if it works for you...

from jsviews.

johan-ohrn avatar johan-ohrn commented on July 18, 2024

Works like a charm, thanks!

At this point one would hope IE8 is not a concern. I think you can do as you did with unicode support and place polyfills in a separate file to prevent cluttering the main js file(s). I.e. jsviews.ie8.js, jsviews.ie9.js...
That would give you more freedom to use more modern apis and remain backwards compatible.
I note that there are polyfills on MDN:
https://developer.mozilla.org/en-US/docs/Web/API/ParentNode/lastElementChild
https://developer.mozilla.org/en-US/docs/Web/API/NonDocumentTypeChildNode/previousElementSibling

Interestingly its stated that previousElementSibling is only partially supported for IE9.

from jsviews.

BorisMoore avatar BorisMoore commented on July 18, 2024

I have been considering the jsviews.ie8.js idea, but I'm inclined to limit backward compat goals to IE9, not IE8.

Currently all the code should be IE9 compatible, including the new code from this fix. (My tests all pass in IE9).
OTOH, there are a few features (such as sort and filter on the {{for}} tag) which already fail in IE8. If I provide a polyfill, then I would need to commit to testing in IE8 with the polyfill included. I'd prefer not to add to the testing matrix. (IE8 has a lot of inconsistent white-space rendering that makes testing more time consuming.)

That said, when users encounter the fact that Array.map or element.previousElementSibling are undefined in IE8, they are clearly free to add a polyfill themselves (and would need to test it in their environment....)

from jsviews.

BorisMoore avatar BorisMoore commented on July 18, 2024

This has been resolved in v1.0.11.

from jsviews.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.