Fixing the search in page for IOS
This commit is contained in:
parent
8563a1bf6f
commit
07330b4678
@ -123,7 +123,18 @@ function addListenersSearch() {
|
|||||||
function searchInWebsite(value, isToBottom) {
|
function searchInWebsite(value, isToBottom) {
|
||||||
window.find(value, false, !isToBottom, true)
|
window.find(value, false, !isToBottom, true)
|
||||||
const selection = window.getSelection()
|
const selection = window.getSelection()
|
||||||
|
if (selection.anchorNode === null) {
|
||||||
|
const pageContents = document.querySelector('div.page-contents');
|
||||||
|
pageContents.focus()
|
||||||
|
searchInWebsite(value, isToBottom)
|
||||||
|
}
|
||||||
const anchorNode = selection.anchorNode.parentNode
|
const anchorNode = selection.anchorNode.parentNode
|
||||||
|
if (anchorNode.tagName !== null
|
||||||
|
&& anchorNode.tagName === "INPUT") {
|
||||||
|
const pageContents = document.querySelector('div.page-contents');
|
||||||
|
pageContents.focus()
|
||||||
|
searchInWebsite(value, isToBottom)
|
||||||
|
}
|
||||||
if (anchorNode !== null) {
|
if (anchorNode !== null) {
|
||||||
const pageContents = document.querySelector('div.page-contents');
|
const pageContents = document.querySelector('div.page-contents');
|
||||||
const offsetTop = _getOffsetTopWithNParent(anchorNode, pageContents);
|
const offsetTop = _getOffsetTopWithNParent(anchorNode, pageContents);
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user