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

Fix: Scrollable dialog #411

Closed
wants to merge 15 commits into from
Closed

Fix: Scrollable dialog #411

wants to merge 15 commits into from

Conversation

jonasnobile
Copy link
Member

@jonasnobile jonasnobile commented Aug 18, 2022

Scroll inside dialog when content is longer than viewport.


This change is Reviewable

@github-actions
Copy link

github-actions bot commented Aug 18, 2022

Playwright Test Report

@jonasnobile jonasnobile force-pushed the pr/scrollable-dialog branch from 47cfafc to e7d0eb1 Compare August 18, 2022 11:02
@jonasnobile jonasnobile requested a review from attitude August 18, 2022 15:01
Copy link
Contributor

@attitude attitude left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r1, 3 of 3 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @jonasnobile)


packages/ui/src/styles/components/dialog.sass line 38 at r2 (raw file):

		animation: #{$cui-conf-globalPrefix}dialogIntroIn .2s .1s forwards
		max-height: 100%
		overflow-y: auto

This change seems to have no unnecessary side effects. However,... it way more safer not to have Dialogs direct responsibility solving overflow caused by unknown children. Moreover, the margin: 1em would cause children to look weirdly cropped, scrolling would hide the action buttons under the fold.

Solution would be to wrap dialog children with DialogModal, add overflow: auto rule to div with .cui-dialog-modal-body-wrapper class. This solution solves overflow needs but also protects important header/footer to be hidden when scrolled away.

Are you sure this change is necessary and you cannot use the DialogModal ui component?

Copy link
Member Author

@jonasnobile jonasnobile left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @attitude)


packages/ui/src/styles/components/dialog.sass line 38 at r2 (raw file):

Previously, attitude (Martin Adamko) wrote…

This change seems to have no unnecessary side effects. However,... it way more safer not to have Dialogs direct responsibility solving overflow caused by unknown children. Moreover, the margin: 1em would cause children to look weirdly cropped, scrolling would hide the action buttons under the fold.

Solution would be to wrap dialog children with DialogModal, add overflow: auto rule to div with .cui-dialog-modal-body-wrapper class. This solution solves overflow needs but also protects important header/footer to be hidden when scrolled away.

Are you sure this change is necessary and you cannot use the DialogModal ui component?

I'm not using any UI component alone. I've discovered this bug thanks to SelectField createNewForm feature. Is it possible to use DialogModal instead of Dialog in SelectField component?

Copy link
Contributor

@attitude attitude left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @jonasnobile)


packages/ui/src/styles/components/dialog.sass line 38 at r2 (raw file):

Previously, jonasNobile (Jonáš Nobile) wrote…

I'm not using any UI component alone. I've discovered this bug thanks to SelectField createNewForm feature. Is it possible to use DialogModal instead of Dialog in SelectField component?

By SelectField you mean the [+] button of select-or-create feature? Anyways I see no reason why the DialogModal could not be used to wrap children inside the Dialog (not instead).

Could you try wrapping the create children of the dialog with DialogModal instead to fix your issue?

Copy link
Member Author

@jonasnobile jonasnobile left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @attitude)


packages/ui/src/styles/components/dialog.sass line 38 at r2 (raw file):

Previously, attitude (Martin Adamko) wrote…

By SelectField you mean the [+] button of select-or-create feature? Anyways I see no reason why the DialogModal could not be used to wrap children inside the Dialog (not instead).

Could you try wrapping the create children of the dialog with DialogModal instead to fix your issue?

Dialog with DialogModal looks visually better, but didn't solve overflow problem.

@matej21 matej21 added this to the 1.2 milestone May 22, 2023
@matej21 matej21 modified the milestones: 1.2, 1.3 Jun 13, 2023
@attitude attitude force-pushed the pr/scrollable-dialog branch from 120d546 to 9dffa8e Compare July 1, 2023 21:19
@attitude attitude force-pushed the pr/scrollable-dialog branch from 407c53f to decbe4d Compare July 1, 2023 21:43
@jonasnobile jonasnobile reopened this Dec 11, 2023
@jonasnobile
Copy link
Member Author

#651

@matej21 matej21 deleted the pr/scrollable-dialog branch June 10, 2024 09:43
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.

3 participants