mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-10-02 15:25:26 +00:00
handle bad safari behavior w/ respect to text selection API
fixes https://github.com/bigskysoftware/htmx/issues/438 thank you @pavelfeldman for finding the root cause!
This commit is contained in:
parent
6f8899f6fd
commit
665fc4bda7
14
src/htmx.js
14
src/htmx.js
@ -2274,11 +2274,15 @@ return (function () {
|
||||
try {
|
||||
|
||||
var activeElt = document.activeElement;
|
||||
var selectionInfo = {
|
||||
elt: activeElt,
|
||||
start: activeElt ? activeElt.selectionStart : null,
|
||||
end: activeElt ? activeElt.selectionEnd : null
|
||||
};
|
||||
try {
|
||||
var selectionInfo = {
|
||||
elt: activeElt,
|
||||
start: activeElt ? activeElt.selectionStart : null,
|
||||
end: activeElt ? activeElt.selectionEnd : null
|
||||
};
|
||||
} catch (e) {
|
||||
var selectionInfo = {}; // safari issue - see https://github.com/microsoft/playwright/issues/5894
|
||||
}
|
||||
|
||||
var settleInfo = makeSettleInfo(target);
|
||||
selectAndSwap(swapSpec.swapStyle, target, elt, serverResponse, settleInfo);
|
||||
|
Loading…
x
Reference in New Issue
Block a user