@1024pix/pix-ui 47.0.2 → 47.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -37,6 +37,10 @@ export default class PixSelect extends Component {
|
|
|
37
37
|
element.style.setProperty('--pix-select-width', `${selectWidth}rem`);
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
+
|
|
41
|
+
this.elementHelper.waitForElement(`container-${this.selectId}`).then((element) => {
|
|
42
|
+
this.rootElement = element;
|
|
43
|
+
});
|
|
40
44
|
}
|
|
41
45
|
|
|
42
46
|
get displayDefaultOption() {
|
|
@@ -151,11 +155,11 @@ export default class PixSelect extends Component {
|
|
|
151
155
|
focus() {
|
|
152
156
|
if (this.isExpanded) {
|
|
153
157
|
if (this.args.value) {
|
|
154
|
-
|
|
158
|
+
this.rootElement.querySelector("[aria-selected='true']").focus();
|
|
155
159
|
} else if (this.args.isSearchable) {
|
|
156
160
|
document.getElementById(this.searchId).focus();
|
|
157
161
|
} else if (this.displayDefaultOption) {
|
|
158
|
-
|
|
162
|
+
this.rootElement.querySelector("[aria-selected='true']").focus();
|
|
159
163
|
}
|
|
160
164
|
}
|
|
161
165
|
}
|