10 examples of 'javascript unfocus' in JavaScript

Every line of 'javascript unfocus' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
183function unfocus() {
184 if (window.getSelection().type !== 'None') {
185 window.getSelection()
186 .removeAllRanges();
187 }
188}
191value: function unFocus() {
192 if (document.selection) {
193 document.selection.empty();
194 } else {
195 window.getSelection().removeAllRanges();
196 }
197}
113focus() {
114 if (this.lastSelection) this.editor.setSelection(this.lastSelection);
115 else this.root.focus();
116}
235focus () {
236 this._input && this._input.focus()
237}
500focus() {
501 const el = this._getContainer();
502 if (el) {
503 el.focus();
504 }
505}
111focus() {
112 this.domNode.focus();
113}
23export function focusInput(element) {
24 if (!element) return;
25
26 const textNode = findLastTextNode(element);
27 if (textNode) {
28 const range = document.createRange();
29 range.setStart(textNode, textNode.length);
30 range.collapse(true);
31
32 const selection = window.getSelection();
33 selection.removeAllRanges();
34 selection.addRange(range);
35 }
36
37 element.focus();
38}
23function unBlur() {
24 var fbContentCol = document.getElementById('contentCol');
25 var fbLeftCol = document.getElementById('leftCol');
26 fbContentCol.style = "filter: blur(0px)";
27 fbLeftCol.style = "filter: blur(0px)";
28 console.log("tried to unblur");
29}
21focus() {
22 const self = ReactDOM.findDOMNode(this) as HTMLElement;
23 const input = self.tagName === "INPUT" ? self as HTMLInputElement : self.querySelector("input");
24 console.log(self, input);
25 input.select();
26}
126function focus(id) {
127 var inputField = document.getElementById(id);
128 if (inputField != null && jQuery(inputField).is(":text,textarea,:password") &&
129 inputField.value && inputField.value.length != 0) {
130 if (inputField.createTextRange) {
131 var FieldRange = inputField.createTextRange();
132 FieldRange.moveStart('character', inputField.value.length);
133 FieldRange.collapse();
134 FieldRange.select();
135 } else if (inputField.selectionStart ||
136 (inputField.selectionStart != undefined && inputField.selectionStart == '0')) {
137 var elemLen = inputField.value.length;
138 inputField.selectionStart = elemLen;
139 inputField.selectionEnd = elemLen;
140 inputField.focus();
141 }
142 } else if (inputField != null) {
143 inputField.focus();
144 }
145}

Related snippets