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: Confirmation modal can be very narrow #976 #1018

Closed
wants to merge 4 commits into from

Conversation

nadeem-R17
Copy link

Done

  • Given a minimum width to the confirmation modal so that width doesn't become narrow when there isn't a lot of content.

Fixes

Fixes: canonical/vanilla-framework#5359 .

ConfirmationModal.-.Docs.Storybook.mp4

@webteam-app
Copy link

nadeem-R17 is not a collaborator of the repo

@@ -62,7 +62,9 @@ export const ConfirmationModal = ({
}
{...props}
>
{children}
<div style={{ minWidth: '480px' }}>
Copy link
Contributor

Choose a reason for hiding this comment

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

This is problematic, if the screen size is lower than 480px.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for bringing that to my attention. I've addressed the issue by implementing an adjustable minWidth for the content, taking into consideration screen sizes lower than 480px. If you have any further suggestions or if additional changes are needed, please feel free to let me know.

ConfirmationModal.-.Docs.Storybook.-.Google.Chrome.2024-01-22.11-04-04.mp4

@@ -43,6 +43,25 @@ export const ConfirmationModal = ({
onConfirm,
...props
}: Props): ReactElement => {
const [minWidth, setMinWidth] = useState("480px");
useEffect(() => {
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the suggestion @nadeem-R17, but this seems a bit too complex and arbitrary solution for a styling issue.

It seems that it would need to be addressed in Vanilla CSS framework (that is the source of the styles), rather then programatically in React code.
So a Vanilla CSS modal component would need to define min width, respecting different screen size breakpoints supported by Vanilla, or possibly utilising modern min() function in CSS.

@bartaz
Copy link
Member

bartaz commented Sep 30, 2024

Thanks for your proposal @nadeem-R17, but we need to address it differently.

@bartaz bartaz closed this Sep 30, 2024
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.

Confirmation modal can be very narrow
4 participants