Add FocusOptions to setFocus() methods

pull/481/head
Cory LaViska 2021-01-07 10:13:08 -05:00
rodzic da20e44d52
commit abf03a8f9e
11 zmienionych plików z 21 dodań i 21 usunięć

Wyświetl plik

@ -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. */

Wyświetl plik

@ -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. */

Wyświetl plik

@ -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. */

Wyświetl plik

@ -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. */

Wyświetl plik

@ -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. */

Wyświetl plik

@ -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. */

Wyświetl plik

@ -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. */

Wyświetl plik

@ -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. */

Wyświetl plik

@ -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');

Wyświetl plik

@ -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. */

Wyświetl plik

@ -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. */