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

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
- Transpile non-minified bundles Fixes issue #172 Also targets browsers that support ESM when transpiling for the ESM build, rather than targetting browsers with ES5 support. — committed to focus-trap/focus-trap by stefcameron 4 years ago
- Transpile non-minified bundles Fixes issue #172 Also targets browsers that support ESM when transpiling for the ESM build, rather than targetting browsers with ES5 support. — committed to focus-trap/focus-trap by stefcameron 4 years ago
- Transpile non-minified bundles (#173) Fixes issue #172 Also targets browsers that support ESM when transpiling for the ESM build, rather than targetting browsers with ES5 support. * Babel pres... — committed to focus-trap/focus-trap by stefcameron 4 years ago
- Bump tabbable dependency to 5.1.1 That version of tabbable has transpiled non-minified bundles, which will help with #172. — committed to focus-trap/focus-trap by stefcameron 4 years ago
- Bump tabbable dependency to 5.1.1 (#176) That version of tabbable has transpiled non-minified bundles, which will help with #172. — committed to focus-trap/focus-trap by stefcameron 4 years ago
- Add browser entry to package.json Fixes #172 again. AFAICT, this seems to be the best solution to what __a lot__ of folks in the community have been experiencing with ESM bundles, referenced from a ... — committed to focus-trap/focus-trap by stefcameron 4 years ago
- Transpile the ESM bundle to ES5 but still use ES module system (#181) Fixes #172 again. See https://github.com/webpack/webpack/issues/5756 The initial approach was to add a `browser` target to ... — committed to focus-trap/focus-trap by stefcameron 4 years ago
- Bump tabbable to 5.1.2 To help close the gap with #172, bump the version since it has a similar fix to tabbable. — committed to focus-trap/focus-trap by stefcameron 4 years ago
- Bump tabbable to 5.1.2 (#184) To help close the gap with #172, bump the version since it has a similar fix to tabbable. — committed to focus-trap/focus-trap by stefcameron 4 years ago
@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.jsin 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.3that bumpstabbableto 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.