TypeScript’s override keyword (added in 4.3) works similarly to @Override in Java. It makes the intention clear and ensures there is actually a member in the base class with the same name. This helps with things like:
- Typos in the overriding member name
- Remember to rename members in sub classes when renaming an overridden member in a base class
class Parent {
foo() {}
}
class Child extends Parent {
override bar() {}
// ~~~ This member cannot have an 'override' modifier because it is not declared in the base class 'Parent'.
}
This change will not cause a runtime change: the override keyword is not present in the resulting JavaScript.
PiperOrigin-RevId: 392018020
- Relies on `FormDataEvent`, which is supported by Chrome, Firefox, and Edge.
- Safari and IE will need a polyfill
- Require `disabled` properties on FormElement subclasses
- Add `setFormData()` function to control what is added to the Form submission
- Set `checkbox` and `radio` `value` property to `on` by default, to match native controls
Fixes#289
PiperOrigin-RevId: 385248919
* initial scaffolding for dialog
* add focus and blur functions to mwc-button
* flesh out dialog implementation
* do not display action footer if no actions slotted
* only layout on listeners if open
* run formatter
* scrollable actually is handled by adapter / found
* fix reversing of actions
* - slotchange + `hideActions`, buttons->actions
* fix slotted styles
* remove style tag mutation
* change style dependencies
* don't leak mdc in dialog actions and initial-focus atributes
* make action and focus attributes configurable
* add css custom properties to dialog
* forgot to change checkbox to dialog
* dialog was made in 2019
* button -> action and remove isVisible
* removed leaky events from dialog lifecycle
* clean up tsconfig
* add unit tests
* textfield -> dialog
* run formatter
* fix multiple dialogs
* fix scrolling
* try to make max-width better
* initial pass at making older tests pass
* escape key on document instead
* run formatter
* fix lint issues
* try more arcane keyboardevent for older browsers
* fix styling associated with multiple in sec action
* fix focus on textfield
* also fix blur on textfield
* mwc-dialog demo
* add dialog to the main demo page
* fix typo in demo
* fix style edge case max-width too small cause jump
* redo change to max-width jumping
* first half of readme
* include video tag in static urlify script
* finish readme
* regenerate package-lock
* fix readme typo
* change confirmation gif size
* cleanup extraneous readme code
* do not override mdcfoundation.open
* make stacked a css change rather than DOM
* make stacked a css change rather than DOM impl
* add color swatches to readme
* fix all test file copyright dates
* add in the styles for the list in the readme
* use formfield in confirmation example
* scrollable degification
* make styled example the same as spec page
* dedupe initial focused example readme
* small dialog readme fixes
* update initial focus readme example
* moved alert example to top and commented out Simple example
* update standard gif to be static
* move event listeners to open an close
* readme change suggestions
* HTMLSlotElement removed from public props
* make public props lit element props
* primary-action => primaryAction; d-i-f => dIF;
* implement suggestions
* run formatter
* resolve merge issues
* add focus and blur functions to mwc-button
* fix focus on textfield
* also fix blur on textfield
* run formatter
* update changelog
* lintfix
* update changelog to match older style
* make ripple a dep vs dev dep
* focus and blur buttons with or without ripple
This adds a lit directive implementation of @material/mdc-snackbar/util.ts#announce, which does some tricks to ensure that snackbar labels will be handled correctly by screen readers.
The existing MDC announce util function is difficult to use directly here, because Lit can crash when DOM that it is managing changes outside of its purvue. In this case, we would render our labelText as the text content of the label div, but the MDC announce function then clears that
text content, and resets it after a timeout. We do the same thing here, but in a way that fits into Lit's lifecycle.