kopia lustrzana https://github.com/shoelace-style/shoelace
add click method
rodzic
619758cbc3
commit
784c173728
|
@ -8,6 +8,7 @@ _During the beta period, these restrictions may be relaxed in the event of a mis
|
|||
|
||||
## Next
|
||||
|
||||
- Added `click()` method to `sl-checkbox`, `sl-radio`, and `sl-switch`
|
||||
- Fixed a bug in `sl-tooltip` where events weren't properly cleaned up on disconnect
|
||||
- Fixed a bug in `sl-tooltip` where they wouldn't display after toggling `disabled` off and on again [#391](https://github.com/shoelace-style/shoelace/issues/391)
|
||||
- Improved a11y for disabled buttons that are rendered as links
|
||||
|
|
|
@ -86,7 +86,6 @@ export default class SlButton extends LitElement {
|
|||
|
||||
/** Simulates a click on the button. */
|
||||
click() {
|
||||
this.button.focus();
|
||||
this.button.click();
|
||||
}
|
||||
|
||||
|
|
|
@ -63,6 +63,11 @@ export default class SlCheckbox extends LitElement {
|
|||
this.input.indeterminate = this.indeterminate;
|
||||
}
|
||||
|
||||
/** Simulates a click on the checkbox. */
|
||||
click() {
|
||||
this.input.click();
|
||||
}
|
||||
|
||||
/** Sets focus on the checkbox. */
|
||||
focus(options?: FocusOptions) {
|
||||
this.input.focus(options);
|
||||
|
|
|
@ -55,6 +55,11 @@ export default class SlRadio extends LitElement {
|
|||
/** Emitted when the control gains focus. */
|
||||
@event('sl-focus') slFocus: EventEmitter<void>;
|
||||
|
||||
/** Simulates a click on the radio. */
|
||||
click() {
|
||||
this.input.click();
|
||||
}
|
||||
|
||||
/** Sets focus on the radio. */
|
||||
focus(options?: FocusOptions) {
|
||||
this.input.focus(options);
|
||||
|
|
|
@ -55,6 +55,11 @@ export default class SlSwitch extends LitElement {
|
|||
/** Emitted when the control gains focus. */
|
||||
@event('sl-focus') slFocus: EventEmitter<void>;
|
||||
|
||||
/** Simulates a click on the switch. */
|
||||
click() {
|
||||
this.input.click();
|
||||
}
|
||||
|
||||
/** Sets focus on the switch. */
|
||||
focus(options?: FocusOptions) {
|
||||
this.input.focus(options);
|
||||
|
|
Ładowanie…
Reference in New Issue