mirror of
https://github.com/material-components/material-web.git
synced 2024-10-26 21:56:56 +03:00
fix(dialog): buttons not reflecting value attribute when setting property
Fixes #5409 PiperOrigin-RevId: 600541901
This commit is contained in:
parent
fcdfa33a2e
commit
35913a6ea4
@ -14,8 +14,8 @@ import {ARIAMixinStrict} from '../../internal/aria/aria.js';
|
||||
import {requestUpdateOnAriaChange} from '../../internal/aria/delegate.js';
|
||||
import {
|
||||
FormSubmitter,
|
||||
type FormSubmitterType,
|
||||
setupFormSubmitter,
|
||||
type FormSubmitterType,
|
||||
} from '../../internal/controller/form-submitter.js';
|
||||
import {
|
||||
dispatchActivationClick,
|
||||
@ -78,9 +78,17 @@ export abstract class Button extends buttonBaseClass implements FormSubmitter {
|
||||
@property({type: Boolean, attribute: 'has-icon', reflect: true}) hasIcon =
|
||||
false;
|
||||
|
||||
/**
|
||||
* The default behavior of the button. May be "text", "reset", or "submit"
|
||||
* (default).
|
||||
*/
|
||||
@property() type: FormSubmitterType = 'submit';
|
||||
|
||||
@property() value = '';
|
||||
/**
|
||||
* The value added to a form with the button's name when the button submits a
|
||||
* form.
|
||||
*/
|
||||
@property({reflect: true}) value = '';
|
||||
|
||||
get name() {
|
||||
return this.getAttribute('name') ?? '';
|
||||
|
@ -16,8 +16,8 @@ import {ARIAMixinStrict} from '../../internal/aria/aria.js';
|
||||
import {requestUpdateOnAriaChange} from '../../internal/aria/delegate.js';
|
||||
import {
|
||||
FormSubmitter,
|
||||
type FormSubmitterType,
|
||||
setupFormSubmitter,
|
||||
type FormSubmitterType,
|
||||
} from '../../internal/controller/form-submitter.js';
|
||||
import {isRtl} from '../../internal/controller/is-rtl.js';
|
||||
import {
|
||||
@ -91,9 +91,17 @@ export class IconButton extends iconButtonBaseClass implements FormSubmitter {
|
||||
*/
|
||||
@property({type: Boolean, reflect: true}) selected = false;
|
||||
|
||||
/**
|
||||
* The default behavior of the button. May be "text", "reset", or "submit"
|
||||
* (default).
|
||||
*/
|
||||
@property() type: FormSubmitterType = 'submit';
|
||||
|
||||
@property() value = '';
|
||||
/**
|
||||
* The value added to a form with the button's name when the button submits a
|
||||
* form.
|
||||
*/
|
||||
@property({reflect: true}) value = '';
|
||||
|
||||
get name() {
|
||||
return this.getAttribute('name') ?? '';
|
||||
|
Loading…
Reference in New Issue
Block a user