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

feat(modal): add new prop to disable close button from modal (#17410) #17444

Conversation

CaiqueSobral
Copy link

Closes #17410

Added a new boolean prop to Modal to not display the close button.

Changelog

New

  • Added a new boolean prop to Modal to not display the close button.

Testing / Reviewing

The close button from a modal should not be displayed if "closeButtonDisabled" prop is set in the modal root

Copy link
Contributor

github-actions bot commented Sep 14, 2024

All contributors have signed the DCO.
Posted by the DCO Assistant Lite bot.

@CaiqueSobral
Copy link
Author

I have read the DCO document and I hereby sign the DCO.

Copy link

netlify bot commented Sep 14, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit ddfe80d
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/6707ef264095d800080237d3
😎 Deploy Preview https://deploy-preview-17444--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Sep 14, 2024

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit ddfe80d
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/6707ef264e1b270008c42318
😎 Deploy Preview https://deploy-preview-17444--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Oct 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.33%. Comparing base (8ec84a4) to head (5932431).
Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #17444   +/-   ##
=======================================
  Coverage   78.33%   78.33%           
=======================================
  Files         408      408           
  Lines       14015    14015           
  Branches     4324     4324           
=======================================
  Hits        10979    10979           
  Misses       2868     2868           
  Partials      168      168           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@tay1orjones tay1orjones left a comment

Choose a reason for hiding this comment

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

Hey thanks for suggesting this! Curious, why does onRequestClose not work for your use case?

I'm not sure if disabling the close button is something we want to encourage from a ux or a11y perspective. I think the intent would be to use onRequestClose to stop the modal from closing when necessary and additionally adding an inline notification to inform the user why the modal can not be closed.

@laurenmrice what do you think?

If we land on this being a good idea we'll additionally need to override preventCloseOnClickOutside to be true.

@CaiqueSobral
Copy link
Author

@tay1orjones. It is not actually a case of mine, it is better explained in this issue #17410

@tay1orjones
Copy link
Member

@CaiqueSobral Ah, my mistake, I thought you were the original issue author. For now this isn't something we're going to add to Modal without strong reasoning due to the accessibility implications.

Thanks again for your work here, I'm sorry to close this on you. Issues labelled proposal: open This request has gone through triaging. We're determining whether we take this on or not. and/or status: needs triage 🕵️‍♀️ typically aren't ready to be worked yet. The needs: community contribution Due to roadmap and resource availability, we are looking for outside contributions on this issue. list is a better one to pull from if you're looking to pick something up.

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.

[Feature Request]: Modal - Disable close button
2 participants