-
Notifications
You must be signed in to change notification settings - Fork 112
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
Add support for passing in multiple elements #217
Conversation
Note that only passing in a single element is still supported
🦋 Changeset detectedLatest commit: 7e26ac7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
After this PR is merged, this PR will be good to go: focus-trap/focus-trap-react#179, after a version bump of course. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cgood92 Nice work! My comments are mostly geared to crossing some Ts and dotting some Is, and maybe simplifying a bit of the code, but overall, I think the change is pretty solid!
Now I'm thinking of #199 in context of this change. I think that for the use case described there about the notification while in a modal, we would need some way that an existing trap can be given a new set of container elements, possibly entirely different from that with which it was initial created.
I believe that's what you've enabled with the new updateContainerElements()
method on the trap object. Is that correct?
@stefcameron thank you very much for the timely review. I appreciate the comments. I have gone through and made every adjustment asked for. If it is all right, not at all to be contrary or rude, I may follow up on a few of the comments, just to shed a different perspective - all for the sake of introducing to new ideas, not at all to banter or anything. Again, I've already made the changes, so I'm not arguing for their need or not, just giving some different opinions, that is all. Let me know if there is anything else I can do! At Workfront, we are using this component, and would love to update as soon as we can. |
Thank you! 😄 Checking this out... 👀
Certainly, I appreciate the different perspective!
Cool! Hey, Adobe is acquiring Workfront, nice. Well, assuming you like Adobe. I worked for Adobe for 10 years. Great company! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding that additional test case, as well as providing your perspective on use of multiple variables. I can appreciate how it can help with readability.
One comment I'd like your thoughts on...
@cgood92 I saw an issue with styling in the multi-trap demo, and also thought we could enhance the demos to show off this functionality a bit better with some highlights, so I just pushed 4bc72f0 to your fork. We can revert if you don't like it, but here are the befores and afters: No functional changes to anything, though. |
I have to say, this change is looking solid! I think we can declare it done after fixing the returns from |
Looks all good to go. Thanks! @stefcameron! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks solid to me! 💪
Fixes #199 |
@all-contributors please add @cgood92 for code, docs, examples, tests |
I've put up a pull request to add @cgood92! 🎉 |
Published in 6.2.0 |
Add support for passing in multiple elements
Note that only passing in a single element is still supported
Features and Bug Fixes
yarn changeset
locally to add one, follow prompts).Demo 1
Demo 2