mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-10-04 16:25:09 +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
@ -2274,11 +2274,15 @@ return (function () {
|
|||||||
try {
|
try {
|
||||||
|
|
||||||
var activeElt = document.activeElement;
|
var activeElt = document.activeElement;
|
||||||
|
try {
|
||||||
var selectionInfo = {
|
var selectionInfo = {
|
||||||
elt: activeElt,
|
elt: activeElt,
|
||||||
start: activeElt ? activeElt.selectionStart : null,
|
start: activeElt ? activeElt.selectionStart : null,
|
||||||
end: activeElt ? activeElt.selectionEnd : null
|
end: activeElt ? activeElt.selectionEnd : null
|
||||||
};
|
};
|
||||||
|
} catch (e) {
|
||||||
|
var selectionInfo = {}; // safari issue - see https://github.com/microsoft/playwright/issues/5894
|
||||||
|
}
|
||||||
|
|
||||||
var settleInfo = makeSettleInfo(target);
|
var settleInfo = makeSettleInfo(target);
|
||||||
selectAndSwap(swapSpec.swapStyle, target, elt, serverResponse, settleInfo);
|
selectAndSwap(swapSpec.swapStyle, target, elt, serverResponse, settleInfo);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user