[ ] tab key cycles through contents without hitting primary page
[ ] shift tab cycles in reverse
[ ] enter key submits if applicable (expose directive?)
[ ] esc should close (optional - default true)
[ ] role="dialog"
[ ] When the modal is open, everything behind it has HTML attribute aria-hidden="true", so assistive technology won't read out the underlying page. The best way to do this is to give the modal and the page separate wrapper elements and toggle aria-hidden="true"/aria-hidden="false" on the main page's wrapper depending on whether or not the modal is open.
[ ] contains heading
[ ] has aria-labelledby attribute whose value is the id of the modal’s heading
[ ] Expose custom CSS properties
[ ] custom transition
[ ] custom backdrop background
[ ] custom gutter? (this could allow custom sizing from a single css property)
Style
backdrop: grey-90 at 85% opacity
title 20px/ 25px 700, 6px margin bottom
close icon: 10px wide, gray 70 3E464C
header padding: 24 24 16 24
footer/header border: 1px solid E9EBED - full width
footer padding: 16 24 24 24
panel: border radius 4
panel background: #fff
[ ] Expose directive to autofocus a specific element when the modal becomes visible
This will offer 2 basic tools:
a) The dialog service b) a base dialog component
Requirements
Service
TsDialogService
canDismiss
is an option set to true by default.Component
<ts-dialog-header>My custom HTML</ts-dialog-header>
title: string
subTitle: string
canDismiss
is true)<ts-dialog-footer>My custom HTML</ts-dialog-footer>
cdkTrapFocus
)aria-labelledby
attribute whose value is the id of the modal’s heading[ ] Expose directive to autofocus a specific element when the modal becomes visible
cdkFocusInitial
)cdkFocusInitial
?Example implementations
Service-based examples
Component-based examples
Resources