focus-trap: IE11 not working with latest release

The issue here is that a new feature was added in v6 that does not include ie11 supported code. The culprit is the because the userOptions is being spread onto an object. https://github.com/focus-trap/focus-trap/blob/master/index.js#L48

Introduced in https://github.com/focus-trap/focus-trap/pull/125

Does this code get transpiled or should the src be compliant? I’d be happy to make a fix to it, just want to verify what the intention is!

Error is Expected identifier, string or number @ this line image

Steps to Recreate

  • Update to v6
  • Run in ie11 and see js errors

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 22 (17 by maintainers)

Commits related to this issue

Most upvoted comments

@stefcameron Awesome work! I have pulled down the latest and everything appears to be working as I would expect 💯. Thanks for the quick turnaround on this issue. 😄

@bparish628 👋 Thanks for reaching out! We definitely transpile the code (and those settings, without any browser targets, should be putting everything back down the ES5) – at least, it’s supposed to be getting transpiled!

However, looking at ./dist/focus-trap.js in the published package, I can see that it’s in fact not the case, which isn’t the intent.

I’ll try to fix this ASAP!

I have published focus-trap@6.1.3 that bumps tabbable to 5.1.2, so this should be fixed all the way down.

@bparish628 Should be fixed in #173. Can you have a look, see if it looks good to you?

@bparish628 Oh no, don’t tell me… 🤦 Yep, that’s it. Thank you for being my second set of 👀 . Just couldn’t see it!

I think there’s another issue with babel in that the ESM bundle should be created with ESM browsers as a target, not ES5 browsers, so I’ll take the opportunity to make sure that happens correctly as well while I’m in there.