Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In IE10, readyState is sometimes incorrect and inert tries to observe a document.body which is null #131

Closed
ryanthemanuel opened this issue Aug 5, 2019 · 11 comments

Comments

@ryanthemanuel
Copy link

In IE10, readyState is sometimes incorrect and inert tries to observe a document.body which is null. Possibly this is similar to what is being described in #75.

Basically, from what I can tell, https://github.com/WICG/inert/blob/master/src/inert.js#L481 is flagged incorrectly, and as a result, https://github.com/WICG/inert/blob/master/src/inert.js#L589 crashes due to document.body being null. I see in the comment here: https://github.com/WICG/inert/blob/master/src/inert.js#L588 that this is not always needed (and is actually not in my team's particular case). Is there a way we could expose a way to programmatically disable the document.body functionality?

@robdodson
Copy link
Collaborator

Hey @ryanthemanuel can you tell me how you're loading the polyfill? Is it in the <head> or the end of the <body>. Is it inside of a module of any kind like AMD or a webpack bundle. Just curious about other factors that might lead to this.

@ryanthemanuel
Copy link
Author

@robdodson It's in the head and in a webpack bundle due to the legacy nature of some of the code I'm dealing with.

@ryanthemanuel
Copy link
Author

@robdodson or anyone else, any thoughts on this?

@emilyrohrbough
Copy link

I'm also seeing this issue. We are seeing it when using inert in react code for modal accessibility. I see there is some IE specific code & IE 9 & 10 can be buggy about setting document.readyState = interactive at time. Would it be worth adding an IE check for complete state for IE?

@emilyrohrbough
Copy link

@robdodson any more traction with this?

@robdodson
Copy link
Collaborator

I'll see if @alice and I can chat about it this week. Sorry for the lag.

@alice
Copy link
Member

alice commented Feb 6, 2020

Just making sure I understand, the problem is that on line 483:

    if (document.readyState === 'loading') {

... this check often fails spuriously in IE?

Is the readyState some other non-ready value in those cases?

@robdodson
Copy link
Collaborator

btw we just landed a PR (#145) which may help with this... could folks give v3.0.2 a shot to see if it resolves the issue?

@JakeChampion
Copy link
Contributor

Fixes it for me

@goatandsheep
Copy link
Contributor

@ryanthemanuel can we close this?

@Naglaa2030
Copy link

const a=document. createElement ('p');
a.textContent='ffffffff';
document.body.appendChild(a);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants