Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
Fix missing buttons in Find In Page bar (#3894)
Browse files Browse the repository at this point in the history
* Fix invisible Find Previous & Find Next buttons

Move the corresponding icon assets to the DesginSystem module so that
they can be found at runtime.

Fixes #3699

* Make Find Previous / Find Next buttons initially disabled

When the user hasn't entered any text, the previous/next buttons were
not made disabled, which could be a little bit misleading and was not
consistent with the case where there are no search results.

---------

Co-authored-by: isabelrios <isabelrios@gmail.com>
  • Loading branch information
sryze and isabelrios committed Mar 4, 2024
1 parent 7cb0971 commit cb89e40
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions focus-ios/Blockzilla/Utilities/FindInPageBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,20 @@ class FindInPageBar: UIView {
matchCountView.accessibilityIdentifier = "FindInPage.matchCount"
addSubview(matchCountView)

previousButton.setImage(UIImage(named: "find_previous"), for: [])
previousButton.setImage(.findPrevious, for: [])
previousButton.setTitleColor(.white, for: [])
previousButton.accessibilityLabel = UIConstants.strings.findInPagePreviousLabel
previousButton.addTarget(self, action: #selector(didFindPrevious), for: .touchUpInside)
previousButton.accessibilityIdentifier = "FindInPage.find_previous"
previousButton.isEnabled = false
addSubview(previousButton)

nextButton.setImage(UIImage(named: "find_next"), for: [])
nextButton.setImage(.findNext, for: [])
nextButton.setTitleColor(.white, for: [])
nextButton.accessibilityLabel = UIConstants.strings.findInPageNextLabel
nextButton.addTarget(self, action: #selector(didFindNext), for: .touchUpInside)
nextButton.accessibilityIdentifier = "FindInPage.find_next"
nextButton.isEnabled = false
addSubview(nextButton)

let closeButton = UIButton()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,8 @@ public extension UIImage {
static let delete = UIImage(named: "icon_delete")!
static let hamburgerMenu = UIImage(named: "icon_hamburger_menu")!
static let stopMenu = UIImage(named: "icon_stop_menu")!

// MARK: Find In Page
static let findPrevious = UIImage(named: "find_previous")!
static let findNext = UIImage(named: "find_next")!
}

0 comments on commit cb89e40

Please sign in to comment.