Scroll the highlighted element into view
This commit is contained in:
parent
40018e9332
commit
7ec1b02c99
|
@ -192,6 +192,16 @@
|
||||||
}
|
}
|
||||||
} else if (type === "highlight-setting") {
|
} else if (type === "highlight-setting") {
|
||||||
store.actions.settings.highlight(data.setting)
|
store.actions.settings.highlight(data.setting)
|
||||||
|
|
||||||
|
// Also scroll setting into view
|
||||||
|
const selector = `[data-cy="${data.setting}-prop-control"`
|
||||||
|
const element = document.querySelector(selector)?.parentElement
|
||||||
|
if (element) {
|
||||||
|
element.scrollIntoView({
|
||||||
|
behavior: "smooth",
|
||||||
|
block: "center",
|
||||||
|
})
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
console.warn(`Client sent unknown event type: ${type}`)
|
console.warn(`Client sent unknown event type: ${type}`)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue