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

feat: allow the developer to disable focus trap #138

Merged
merged 2 commits into from
Jun 15, 2021

Conversation

varyoo
Copy link
Contributor

@varyoo varyoo commented Jun 15, 2021

This PR enables the developer to disable the focus trap by setting initialFocusRef to false.

This is useful when there is multiple focus traps. When a modal gets its focus trap back, settings initialFocusRef to false prevent it from jumping to top.

Copy link
Owner

@stipsan stipsan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 🎉 I've been wanting to add this but never had the time 😄 🏅

@nikita-rabykin-onilab
Copy link

Oh yea, It's nice to have this PR merged. I'm using material-ui library and trying to open a bottom sheet in it and I'm getting the "max call stack exceeded".

@stipsan stipsan merged commit ef176b3 into stipsan:main Jun 15, 2021
github-actions bot pushed a commit that referenced this pull request Jun 15, 2021
# [3.3.0](v3.2.1...v3.3.0) (2021-06-15)

### Features

* allow the developer to disable focus trap ([#138](#138)) ([ef176b3](ef176b3))
@github-actions
Copy link

🎉 This PR is included in version 3.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@varyoo
Copy link
Contributor Author

varyoo commented Jun 15, 2021

Thank you for releasing it this fast!!

github-actions bot pushed a commit to la55u/react-spring-bottom-sheet-updated that referenced this pull request Jun 18, 2023
# 1.0.0 (2023-06-18)

### Bug Fixes

* add 18 to react peer dep ([d89c0bb](d89c0bb))
* add CSS sourcemap ([04bf99f](04bf99f))
* add keywords ([05f4399](05f4399))
* add more NaN type guards ([7664d1a](7664d1a))
* API cleanup ([dc2b126](dc2b126))
* avoid dividing by zero during prerender ([ca2b9ae](ca2b9ae))
* better type declarations ([c19dd44](c19dd44))
* better velocity physics ([65390c7](65390c7))
* can be clicked through the overlay on IOS ([b9a2d95](b9a2d95))
* **deps:** bump focus-trap ([a099a54](a099a54))
* **deps:** update dependency @reach/portal to ^0.13.0 ([stipsan#94](https://github.com/la55u/react-spring-bottom-sheet-updated/issues/94)) ([1cc8056](1cc8056))
* **deps:** update dependency focus-trap to v6.2.2 ([9f79d35](9f79d35))
* doh, semantic release pushed v1.0 instead of v0.2 :( ([a5837bd](a5837bd))
* dragging can overshoot if onDismiss is undefined ([stipsan#43](https://github.com/la55u/react-spring-bottom-sheet-updated/issues/43)) ([549ab30](549ab30))
* export prop types ts definitions ([36cf999](36cf999))
* fade out correctly on snap ([17234bc](17234bc))
* filter out taps on drag ([bc709a0](bc709a0))
* guard against NaN in minSnap and maxSnap handlers ([7dbf037](7dbf037))
* improve rubber band effect when out of bounds ([stipsan#29](https://github.com/la55u/react-spring-bottom-sheet-updated/issues/29)) ([4f2fe09](4f2fe09))
* improve TS definitions ([a8102bf](a8102bf))
* iOS display cutouts caused a scrollbar in some cases ([45c182c](45c182c))
* make open transitions more interruptible on iOS ([stipsan#23](https://github.com/la55u/react-spring-bottom-sheet-updated/issues/23)) ([f898dd0](f898dd0))
* microbundle defaults to preact, changed it back to react ([4f52355](4f52355))
* more stable defaultSnap RESIZE sync ([230dbe2](230dbe2))
* only animate on RESIZE if the source = element ([ceb3671](ceb3671))
* readjust defaultSnap on resize ([b812786](b812786))
* remove padding wrappers ([stipsan#57](https://github.com/la55u/react-spring-bottom-sheet-updated/issues/57)) ([60657fb](60657fb))
* RESIZE should never animate the content opacity ([2470ccc](2470ccc))
* rewrite interpolations to always be in frame sync ([cc43467](cc43467))
* TS in microbundle breaks on [...(new Set)], swapping to Array.from ([2402b5a](2402b5a))
* update readme ([ceb55d3](ceb55d3))
* updated readme with more API docs and examples ([6a48fab](6a48fab))
* use layout effect to prevent tearing on Safari ([6b62559](6b62559))
* use rAF instead of timeout to schedule unmount ([7f3c018](7f3c018))
* v2 api ready, just need to clean up and write docs ([96f158e](96f158e))
* xstate deprecation warning on null events ([e44e273](e44e273))

### Features

* add height getter to ref ([51c8510](51c8510))
* Add RESIZE events ([b3ff691](b3ff691))
* add sibling prop support ([767215b](767215b))
* add skipInitialTransition to make skipping opt-in ([f200ad0](f200ad0))
* add source to RESIZE events ([383e206](383e206)), closes [stipsan#53](https://github.com/la55u/react-spring-bottom-sheet-updated/issues/53)
* add springConfig prop ([1a96832](1a96832))
* allow the developer to disable focus trap ([stipsan#138](https://github.com/la55u/react-spring-bottom-sheet-updated/issues/138)) ([ef176b3](ef176b3))
* expand on content drag ([stipsan#141](https://github.com/la55u/react-spring-bottom-sheet-updated/issues/141)) ([ec733a5](ec733a5))
* initial version ([ef3ecfa](ef3ecfa))
* override source and velocity in snapTo ([1afe79f](1afe79f))
* refactor to xstate ([stipsan#46](https://github.com/la55u/react-spring-bottom-sheet-updated/issues/46)) ([6b2f92a](6b2f92a))
* SNAP events now have `source` ([240c212](240c212)), closes [stipsan#87](https://github.com/la55u/react-spring-bottom-sheet-updated/issues/87)
* V2 ([stipsan#17](https://github.com/la55u/react-spring-bottom-sheet-updated/issues/17)) ([8331800](8331800))

### BREAKING CHANGES

* The resize observer logic is rewritten to no longer require wrapper elements like `[data-rsbs-footer-padding]`. If you're not using custom CSS and are simply importing `react-spring-bottom-sheet/dist/style.css` in your app then this isn't a breaking change for you.

If you're using custom CSS, here's the breaking changes:
- `[data-rsbs-header-padding]` removed, update selectors to `[data-rsbs-header]`
- `[data-rsbs-content-padding]` removed, update selectors to `[data-rsbs-scroll]`
- `[data-rsbs-footer-padding]` removed, update selectors to `[data-rsbs-footer]`
- `[data-rsbs-antigap]` removed, update selectors to `[data-rsbs-root]:after` and make sure to add `content: '';`.
- `[data-rsbs-content]` is changed, update selectors to `[data-rsbs-scroll]`.
- The `<div style="overflow:hidden;">` wrapper that used to be between `[data-rsbs-content]` and `[data-rsbs-content-padding]` is now within `[data-rsbs-scroll]`, and no longer hardcode `overflow: hidden`, add `[data-rsbs-content] { overflow: hidden; }` to your CSS.
* this is the real initial release, `v1` is fake software.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants