MCPcopy Create free account
hub / github.com/microsoft/SandDance / setActiveElement

Function setActiveElement

docs/app/js/sanddance-app.js:6717–6722  ·  view source on GitHub ↗
(activeElementInfo, container)

Source from the content-addressed store, hash-verified

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);
6720 if (element) focusActiveElement(element, activeElementInfo);
6721 }
6722}
6723function getActiveElementInfo(container) {
6724 let element = document.activeElement;
6725 const { scrollTop , selectionDirection , selectionEnd , selectionStart } = element;

Callers 1

presentMethod · 0.50

Calls 2

focusActiveElementFunction · 0.70

Tested by

no test coverage detected