MCPcopy Create free account
hub / github.com/violentmonkey/violentmonkey / vFocusFactory

Function vFocusFactory

src/common/ui/index.js:130–146  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

128}
129
130function vFocusFactory() {
131 const handle = (el, value, oldValue) => {
132 if (value === oldValue) return;
133 if (value == null || value) {
134 el.tabIndex = -1;
135 el.focus();
136 }
137 };
138 return {
139 mounted(el, binding) {
140 handle(el, binding.value, {});
141 },
142 updated(el, binding) {
143 handle(el, binding.value, binding.oldValue);
144 },
145 };
146}
147/**
148 * Usage:
149 *

Callers 1

index.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected