mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
fix(list-box-menu-item): avoid element reference error (#1507)
Fixes #1505 Fixes #1503
This commit is contained in:
parent
a657b6e334
commit
affeb2e2f4
1 changed files with 1 additions and 1 deletions
|
@ -12,7 +12,7 @@
|
|||
|
||||
$: isTruncated = ref?.offsetWidth < ref?.scrollWidth;
|
||||
$: title = isTruncated ? ref?.innerText : undefined;
|
||||
$: if (highlighted && !ref?.matches(":hover")) {
|
||||
$: if (highlighted && ref && !ref.matches(":hover")) {
|
||||
// Scroll highlighted item into view if using keyboard navigation
|
||||
ref.scrollIntoView({ block: "nearest" });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue