Skip to content

Conversation

@susnux
Copy link
Contributor

@susnux susnux commented Oct 13, 2023

☑️ Resolves

  1. Revert hack to make unused buttons invisible instead of setting display: none
    The buttons are placed absolute, therefor they do not interact with the modal container and content.
    Meaning even if only on button is shown the modal is centered correctly.
  2. Ensure the modal header does not overflow the modal content
    The modal height is max. 90%, but if the window is not that tall or the modal is tall, then the header might overlap the content. So fix this by setting the modal max. height to 100% - 2*modal-header (because of the centered placement).
  3. Ensure the close button is always clickable and not covert by content. (simply setting a z-index on it).

🖼️ Screenshots

You can see the header no longer overflows the content. And the button is on top of the modal content even if the default content margin of 50px is overridden.

🏚️ Before 🏡 After
Screenshot_20231013_171853 Screenshot_20231013_171949

And for the revert of the visibility hack, here is a "after" screenshot with only on button, you can see it is still centered perfectly:
image

🏁 Checklist

  • ⛑️ Tests are included or are not applicable
  • 📘 Component documentation has been extended, updated or is not applicable

…setting `display: none`

The buttons are placed absolute, therefor they do not interact with the modal container and content.
Meaning even if only on button is shown the modal is centered correctly.

Signed-off-by: Ferdinand Thiessen <[email protected]>
@susnux susnux added bug Something isn't working 3. to review Waiting for reviews feature: modal Related to the modal component labels Oct 13, 2023
@susnux susnux added this to the 8.0.0 milestone Oct 13, 2023
@susnux susnux force-pushed the fix/ncmodal-improvments branch from 5bdefc8 to 4c5b411 Compare October 13, 2023 15:27
Copy link
Contributor

@Antreesy Antreesy left a comment

Choose a reason for hiding this comment

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

Agree with changes

…ert by content

Also ensure that the close button fit into the modal.

Signed-off-by: Ferdinand Thiessen <[email protected]>
@susnux susnux force-pushed the fix/ncmodal-improvments branch from 4c5b411 to 865dbb2 Compare October 13, 2023 15:58
@susnux susnux requested a review from Pytal October 14, 2023 19:30
@raimund-schluessler raimund-schluessler merged commit e96fc4d into master Oct 16, 2023
@raimund-schluessler raimund-schluessler deleted the fix/ncmodal-improvments branch October 16, 2023 19:03
@Pytal Pytal mentioned this pull request Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug Something isn't working feature: modal Related to the modal component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NcModal close button is inaccessible with scrollable content Modals can't be closed on small screens due to header overlap

4 participants