mirror of
https://github.com/Karaka-Management/oms-Editor.git
synced 2026-02-15 17:58:41 +00:00
CS fixes
This commit is contained in:
parent
340cda9c1e
commit
b69556e07e
|
|
@ -31,10 +31,9 @@
|
||||||
const activeEl = document.activeElement;
|
const activeEl = document.activeElement;
|
||||||
const activeElTagName = activeEl ? activeEl.tagName.toLowerCase() : null;
|
const activeElTagName = activeEl ? activeEl.tagName.toLowerCase() : null;
|
||||||
|
|
||||||
if (
|
if ((activeElTagName === 'textarea' || activeElTagName === 'input')
|
||||||
(activeElTagName === 'textarea' || activeElTagName === 'input') &&
|
&& /^(?:text|search|password|tel|url)$/i.test(activeEl.type)
|
||||||
/^(?:text|search|password|tel|url)$/i.test(activeEl.type) &&
|
&& (typeof activeEl.selectionStart === 'number')
|
||||||
(typeof activeEl.selectionStart === 'number')
|
|
||||||
) {
|
) {
|
||||||
text = activeEl.value.slice(activeEl.selectionStart, activeEl.selectionEnd);
|
text = activeEl.value.slice(activeEl.selectionStart, activeEl.selectionEnd);
|
||||||
} else if (window.getSelection) {
|
} else if (window.getSelection) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user