Skip to content

[component] patch: fix body locking unnecessarily#12

Merged
marlonmarcello merged 1 commit into
mainfrom
patch/dont-lock-body-if-not-required
Dec 4, 2023
Merged

[component] patch: fix body locking unnecessarily#12
marlonmarcello merged 1 commit into
mainfrom
patch/dont-lock-body-if-not-required

Conversation

@marlonmarcello
Copy link
Copy Markdown
Member

Description

The modal was setting overflow: hidden to the body even though we were not appending it to the body,

Solution

Used the appendToBody variable to determine if we should lock the body or not.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Dec 2, 2023

🦋 Changeset detected

Latest commit: cab88f4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@wethegit/react-modal Patch

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

@marlonmarcello marlonmarcello self-assigned this Dec 2, 2023
@marlonmarcello marlonmarcello added the bug Something isn't working label Dec 2, 2023
@andrewrubin
Copy link
Copy Markdown
Member

andrewrubin commented Dec 2, 2023

This brings up another interesting question @marlonmarcello , do we also need to disable the focus trap, if appendToBody is false? Or give the option to?

I think we probably don't, as it's still an "alert" that requires the users attention. Thoughts?

@marlonmarcello
Copy link
Copy Markdown
Member Author

@andrewrubin isn't that a best practice regardless if the modal is on the body or not? Like, won't people tabbing just keep going through the site with the modal opened?

@andrewrubin
Copy link
Copy Markdown
Member

Yeah, I think you're right Marlon, let's keep it as is

@marlonmarcello marlonmarcello merged commit f603cd2 into main Dec 4, 2023
@marlonmarcello marlonmarcello deleted the patch/dont-lock-body-if-not-required branch December 4, 2023 17:36
@github-actions github-actions Bot mentioned this pull request Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants