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

refactor(dialog)!: match native <dialog> and fix spacing #4677

Closed
wants to merge 0 commits into from

Conversation

copybara-service[bot]
Copy link

@copybara-service copybara-service bot commented Aug 8, 2023

refactor(dialog)!: match native <dialog> and fix spacing

Fixes #4647
Fixes #4285

BREAKING CHANGE: See #4675 for more details.

Dialogs use the native <dialog> interface, which uses a <form method="dialog"> to set up dialog actions.

<md-dialog>
  <div slot="headline">A simple dialog</div>
  <form id="form" method="dialog" slot="content">
    This is a dialog with text content.
  </form>
  <div slot="actions">
    <md-text-button form="form" value="close">Close</md-text-button>
    <md-text-button form="form" value="ok">OK</md-text-button>
  </div>
</md-dialog>

@github-actions
Copy link
Contributor

github-actions bot commented Aug 8, 2023

Visit the preview URL for this PR (updated for commit 9873587):

https://material-web-catalog--pr4677-cl-554893225-zdsza9lb.web.app

(expires Thu, 17 Aug 2023 23:33:40 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 9963c4140a739ce569c66186ab5a13f37066f076

@copybara-service copybara-service bot changed the title refactor(dialog)!: match native <dialog> APIs refactor(dialog)!: match native <dialog> and fix spacing Aug 8, 2023
<div class="scroller">
<div class="content">
<div class="top anchor"></div>
<slot name="content"></slot>
Copy link
Contributor

Choose a reason for hiding this comment

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

There must be a particular reason for not having a default slot here - but I am not sure which one ?

Copy link
Collaborator

@asyncLiz asyncLiz Aug 9, 2023

Choose a reason for hiding this comment

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

We add margin to the light dom slotted content, which can be customized. This requires a single root node though so we don't add margin spacing to all the internal content.

Requiring a slot attribute helps to encourage only providing a single root node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants