Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
docs(dialog): Expand wording RE layout-sensitive children (#4370)
Browse files Browse the repository at this point in the history
  • Loading branch information
kfranqueiro authored Feb 15, 2019
1 parent 173f202 commit 7ed6123
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/mdc-dialog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ const dialog = new MDCDialog(document.querySelector('.mdc-dialog'));
> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.
MDC Dialog makes no assumptions about what will be added to the `mdc-dialog__content` element. Any List, Checkboxes,
etc. must also be instantiated. Additionally, call `layout` on any applicable components within the content when
`MDCDialog:opened` is emitted.
etc. must also be instantiated. If your dialog contains any layout-sensitive components, you should wait until
`MDCDialog:opened` is emitted to instantiate them (or call `layout` on them) so that the dialog's transition finishes
first.

For example, to instantiate an MDC List inside of a Simple or Confirmation Dialog:

Expand All @@ -103,6 +104,9 @@ dialog.listen('MDCDialog:opened', () => {
});
```

> *NOTE*: Mispositioned or incorrectly-sized elements (e.g. ripples, floating labels, notched outlines) are a strong
> indication that child components are being instantiated before the dialog has finished opening.
## Variants

### Simple Dialog
Expand Down

0 comments on commit 7ed6123

Please sign in to comment.