kopia lustrzana https://github.com/shoelace-style/shoelace
add blur()
rodzic
d6d05121e4
commit
e2012433cb
|
@ -10,6 +10,7 @@ _During the beta period, these restrictions may be relaxed in the event of a mis
|
||||||
|
|
||||||
- 🚨 BREAKING: changed the `type` attribute to `variant` in `<sl-alert>`, `<sl-badge>`, `<sl-button>`, and `<sl-tag>` since it's more appropriate and to disambiguate from other `type` attributes
|
- 🚨 BREAKING: changed the `type` attribute to `variant` in `<sl-alert>`, `<sl-badge>`, `<sl-button>`, and `<sl-tag>` since it's more appropriate and to disambiguate from other `type` attributes
|
||||||
- 🚨 BREAKING: removed `base` part from `<sl-divider>` to simplify the styling API
|
- 🚨 BREAKING: removed `base` part from `<sl-divider>` to simplify the styling API
|
||||||
|
- Added `focus()` and `blur()` methods to `<sl-select>` [#625](https://github.com/shoelace-style/shoelace/pull/625)
|
||||||
- Fixed bug where setting `tooltipFormatter` on `<sl-range>` in JSX causes React@experimental to error out
|
- Fixed bug where setting `tooltipFormatter` on `<sl-range>` in JSX causes React@experimental to error out
|
||||||
- Refactored `<sl-button>` to use Lit's static expressions to reduce code
|
- Refactored `<sl-button>` to use Lit's static expressions to reduce code
|
||||||
- Simplified `<sl-spinner>` animation
|
- Simplified `<sl-spinner>` animation
|
||||||
|
|
|
@ -181,8 +181,12 @@ export default class SlSelect extends LitElement {
|
||||||
|
|
||||||
/** Sets focus on the control. */
|
/** Sets focus on the control. */
|
||||||
focus(options?: FocusOptions) {
|
focus(options?: FocusOptions) {
|
||||||
const box = this.shadowRoot?.querySelector('.select__control') as HTMLElement;
|
this.control.focus(options);
|
||||||
box.focus(options);
|
}
|
||||||
|
|
||||||
|
/** Removes focus from the control. */
|
||||||
|
blur() {
|
||||||
|
this.control.blur();
|
||||||
}
|
}
|
||||||
|
|
||||||
handleBlur() {
|
handleBlur() {
|
||||||
|
@ -452,7 +456,7 @@ export default class SlSelect extends LitElement {
|
||||||
part="base"
|
part="base"
|
||||||
.hoist=${this.hoist}
|
.hoist=${this.hoist}
|
||||||
.stayOpenOnSelect=${this.multiple}
|
.stayOpenOnSelect=${this.multiple}
|
||||||
.containingElement=${this}
|
.containingElement=${this as HTMLElement}
|
||||||
?disabled=${this.disabled}
|
?disabled=${this.disabled}
|
||||||
class=${classMap({
|
class=${classMap({
|
||||||
select: true,
|
select: true,
|
||||||
|
|
Ładowanie…
Reference in New Issue