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

♻️(react) use react aria for select menu + modal updates #323

Merged
merged 3 commits into from
May 16, 2024

Conversation

NathanVss
Copy link
Member

No description provided.

Copy link

changeset-bot bot commented May 14, 2024

🦋 Changeset detected

Latest commit: bdc44b5

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

This PR includes changesets to release 1 package
Name Type
@openfun/cunningham-react 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

Copy link
Member

@jbpenrath jbpenrath left a comment

Choose a reason for hiding this comment

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

When there is not enough space to open the select menu, this one does not open 🤔

CleanShot.2024-05-14.at.16.55.15.mp4

packages/react/src/components/Forms/Select/mono-common.tsx Outdated Show resolved Hide resolved
packages/react/src/components/Modal/index.tsx Outdated Show resolved Hide resolved
@NathanVss
Copy link
Member Author

When there is not enough space to open the select menu, this one does not open 🤔

CleanShot.2024-05-14.at.16.55.15.mp4

I realized that Canvas in mdx are not inside iframe 👀, so I did some edit + avoid flipping for the overlay.

Copy link
Member

@jbpenrath jbpenrath left a comment

Choose a reason for hiding this comment

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

Last comment then LGTM ✅

packages/react/src/components/Forms/Select/select-menu.tsx Outdated Show resolved Hide resolved
The way the menu of the select was made was causing it to be cropped
inside modals, it was due to the fact the menu was nested inside a
position relative parent. Now we use react aria to position in full
absolute the menu, making it to be correctly displayed inside modals.
Having the position fixed and at the same time overflow auto on the same
element was causing absolute children to be cropped. We need to set those
two attribute on two different parent for these children to not be cropped.
Yes this is weird, this is CSS.
This default behavior was causing lots of troubles when using modals.
For instance the Select value were centered, it was also the case for
most of consumer's component inside modals, forcing the users to
set text-align:left on their side, resulting in additionnal work.
Now we use another approach by using a specific div for the content
we want centered.
@NathanVss NathanVss merged commit e53cc73 into main May 16, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants