MCPcopy Index your code
hub / github.com/microsoft/SandDance / focusActiveElement

Function focusActiveElement

docs/app/js/sanddance-app.js:6711–6716  ·  view source on GitHub ↗
(element, activeElementInfo)

Source from the content-addressed store, hash-verified

6709 if (element) return element;
6710}
6711function focusActiveElement(element, activeElementInfo) {
6712 element.focus();
6713 element.scrollTop = activeElementInfo.scrollTop;
6714 const input = element;
6715 if (input.setSelectionRange && activeElementInfo && activeElementInfo.selectionStart != null && activeElementInfo.selectionEnd != null) input.setSelectionRange(activeElementInfo.selectionStart, activeElementInfo.selectionEnd, activeElementInfo.selectionDirection);
6716}
6717function setActiveElement(activeElementInfo, container) {
6718 if (activeElementInfo) {
6719 const element = findElementByChildPositions(activeElementInfo.childPositions, container);

Callers 1

setActiveElementFunction · 0.70

Calls 1

focusMethod · 0.45

Tested by

no test coverage detected