Skip to content

Commit

Permalink
Merge pull request #872 from kiwix/79-fix-find-in-page-availability
Browse files Browse the repository at this point in the history
Fix Find in page availability
  • Loading branch information
kelson42 authored Jul 18, 2024
2 parents 7075ec0 + 57a8f4e commit d4afb15
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion App/CompactViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ private struct Content: View {
systemImage: "die.face.5",
action: { browser.loadRandomArticle() })
.disabled(zimFiles.isEmpty)
ContentSearchButton(webView: browser.webView)
ContentSearchButton()
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Views/BrowserTab.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct BrowserTab: View {
#endif
BookmarkButton()
#if os(iOS)
ContentSearchButton(webView: browser.webView)
ContentSearchButton()
#endif
ArticleShortcutButtons(displayMode: .mainAndRandomArticle)
}
Expand Down
8 changes: 4 additions & 4 deletions Views/BuildingBlocks/ContentSearchButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ import WebKit

struct ContentSearchButton: View {

let webView: WKWebView
@EnvironmentObject private var browser: BrowserViewModel

var body: some View {
Button("common.search".localized,
systemImage: "text.magnifyingglass",
action: {
webView.isFindInteractionEnabled = true
webView.findInteraction?.presentFindNavigator(showingReplace: false)
browser.webView.isFindInteractionEnabled = true
browser.webView.findInteraction?.presentFindNavigator(showingReplace: false)
}
).disabled(webView.url == nil)
).disabled(browser.url == nil)
}
}
#endif

0 comments on commit d4afb15

Please sign in to comment.