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

Improve display for multiple action buttons in notices #31799

Merged

Conversation

laras126
Copy link
Contributor

@laras126 laras126 commented May 13, 2021

Description

When adding multiple buttons via actions in the Notice component, the buttons are each added on a new line. When there are multiple notices and multiple buttons, this becomes quite intrusive and overtakes a significant portion of the browser window.

This PR adds a structural div around the actions in the Notice component, and some styling to align buttons on the same line so that the display is less intrusive when there are multiple notices and multiple actions.

How has this been tested?

Tested in:

  • Safari 14.0.3
  • Firefox Developer 89.0b10 (64-bit) and mobile device simulator
  • Chrome 90.0.4430.212 and mobile device simulator

Screenshots

Without wrapping (current):
Desktop Screenshot without Wrapping Buttons
Mobile Screenshot without Wrapping Buttons

With wrapping (this PR):
Desktop Screenshot with Wrapping Buttons
Mobile Screenshot with Wrapping Buttons
Example of wrapping buttons

Types of changes

This is a bugfix / styling improvement and does not affect any areas of the code-base outside of the Notice component.

Note: The column-gap property would be perfect for this, but due to partial implementation / conflicting naming with the column-gap property used for Grid, it is not possible to detect support via @supports for this property in the Flex context (more info). This is an issue in Safari 14, which is within the two latest versions.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

@laras126 laras126 marked this pull request as ready for review May 13, 2021 22:11
Copy link
Member

@jorgefilipecosta jorgefilipecosta left a comment

Choose a reason for hiding this comment

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

LGTM 👍

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