Skip to content

Commit

Permalink
Fix editor stealing focus from search input in Safari
Browse files Browse the repository at this point in the history
  • Loading branch information
FIameCaster committed Apr 5, 2024
1 parent a3efc3d commit 7645cee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package/src/extensions/search/widget.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { InputSelection, BasicExtension } from "../../index.js"
import { InputSelection, BasicExtension, isWebKit } from "../../index.js"
import {
isChrome,
isMac,
Expand Down Expand Up @@ -66,7 +66,7 @@ export const searchWidget = (): SearchWidget => {
const replaceAPI = createReplaceAPI(editor)

const startSearch = (selectMatch?: boolean) => {
if (selectMatch) textarea.setSelectionRange(...prevUserSelection)
if (selectMatch && !isWebKit) textarea.setSelectionRange(...prevUserSelection)
const error = replaceAPI.search(
findInput.value,
matchCase,
Expand Down

0 comments on commit 7645cee

Please sign in to comment.