FIX: none row doesn’t have a value, use class to target it (#14659)

This commit is contained in:
Joffrey JAFFEUX 2021-10-20 13:07:58 +02:00 committed by GitHub
parent 020ae3e0ff
commit d18e3a45b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -698,9 +698,16 @@ export default Component.extend(
_scrollToRow(rowItem, preventScroll = true) {
const value = this.getValue(rowItem);
const rowContainer = this.element.querySelector(
`.select-kit-row[data-value="${value}"]`
);
let rowContainer;
if (isPresent(value)) {
rowContainer = this.element.querySelector(
`.select-kit-row[data-value="${value}"]`
);
} else {
rowContainer = this.element.querySelector(".select-kit-row.is-none");
}
rowContainer && rowContainer.focus({ preventScroll });
},