kopia lustrzana https://github.com/shoelace-style/shoelace
Add FocusOptions to setFocus() methods
rodzic
da20e44d52
commit
abf03a8f9e
|
@ -89,8 +89,8 @@ export class Button {
|
|||
|
||||
/** Sets focus on the button. */
|
||||
@Method()
|
||||
async setFocus() {
|
||||
this.button.focus();
|
||||
async setFocus(options?: FocusOptions) {
|
||||
this.button.focus(options);
|
||||
}
|
||||
|
||||
/** Removes focus from the button. */
|
||||
|
|
|
@ -78,8 +78,8 @@ export class Checkbox {
|
|||
|
||||
/** Sets focus on the checkbox. */
|
||||
@Method()
|
||||
async setFocus() {
|
||||
this.input.focus();
|
||||
async setFocus(options?: FocusOptions) {
|
||||
this.input.focus(options);
|
||||
}
|
||||
|
||||
/** Removes focus from the checkbox. */
|
||||
|
|
|
@ -174,8 +174,8 @@ export class Input {
|
|||
|
||||
/** Sets focus on the input. */
|
||||
@Method()
|
||||
async setFocus() {
|
||||
this.input.focus();
|
||||
async setFocus(options?: FocusOptions) {
|
||||
this.input.focus(options);
|
||||
}
|
||||
|
||||
/** Removes focus from the input. */
|
||||
|
|
|
@ -43,8 +43,8 @@ export class MenuItem {
|
|||
|
||||
/** Sets focus on the button. */
|
||||
@Method()
|
||||
async setFocus() {
|
||||
this.menuItem.focus();
|
||||
async setFocus(options?: FocusOptions) {
|
||||
this.menuItem.focus(options);
|
||||
}
|
||||
|
||||
/** Removes focus from the button. */
|
||||
|
|
|
@ -74,8 +74,8 @@ export class Radio {
|
|||
|
||||
/** Sets focus on the radio. */
|
||||
@Method()
|
||||
async setFocus() {
|
||||
this.input.focus();
|
||||
async setFocus(options?: FocusOptions) {
|
||||
this.input.focus(options);
|
||||
}
|
||||
|
||||
/** Removes focus from the radio. */
|
||||
|
|
|
@ -81,8 +81,8 @@ export class Range {
|
|||
|
||||
/** Sets focus on the input. */
|
||||
@Method()
|
||||
async setFocus() {
|
||||
this.input.focus();
|
||||
async setFocus(options?: FocusOptions) {
|
||||
this.input.focus(options);
|
||||
}
|
||||
|
||||
/** Removes focus from the input. */
|
||||
|
|
|
@ -60,8 +60,8 @@ export class Rating {
|
|||
|
||||
/** Sets focus on the rating. */
|
||||
@Method()
|
||||
async setFocus() {
|
||||
this.rating.focus();
|
||||
async setFocus(options?: FocusOptions) {
|
||||
this.rating.focus(options);
|
||||
}
|
||||
|
||||
/** Removes focus from the rating. */
|
||||
|
|
|
@ -69,8 +69,8 @@ export class Switch {
|
|||
|
||||
/** Sets focus on the switch. */
|
||||
@Method()
|
||||
async setFocus() {
|
||||
this.input.focus();
|
||||
async setFocus(options?: FocusOptions) {
|
||||
this.input.focus(options);
|
||||
}
|
||||
|
||||
/** Removes focus from the switch. */
|
||||
|
|
|
@ -184,7 +184,7 @@ export class TabGroup {
|
|||
index = Math.min(tabs.length - 1, index + 1);
|
||||
}
|
||||
|
||||
tabs[index].setFocus();
|
||||
tabs[index].setFocus({ preventScroll: true });
|
||||
|
||||
if (['top', 'bottom'].includes(this.placement)) {
|
||||
scrollIntoView(tabs[index], this.nav, 'horizontal');
|
||||
|
|
|
@ -43,8 +43,8 @@ export class Tab {
|
|||
|
||||
/** Sets focus to the tab. */
|
||||
@Method()
|
||||
async setFocus() {
|
||||
this.tab.focus({ preventScroll: true });
|
||||
async setFocus(options?: FocusOptions) {
|
||||
this.tab.focus(options);
|
||||
}
|
||||
|
||||
/** Removes focus from the tab. */
|
||||
|
|
|
@ -153,8 +153,8 @@ export class Textarea {
|
|||
|
||||
/** Sets focus on the textarea. */
|
||||
@Method()
|
||||
async setFocus() {
|
||||
this.textarea.focus();
|
||||
async setFocus(options?: FocusOptions) {
|
||||
this.textarea.focus(options);
|
||||
}
|
||||
|
||||
/** Removes focus fromt the textarea. */
|
||||
|
|
Ładowanie…
Reference in New Issue