Skip to content

Commit

Permalink
[focus-ios] Fix missing buttons in Find In Page bar (mozilla-mobile/f…
Browse files Browse the repository at this point in the history
…ocus-ios#3894)

* 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 mozilla-mobile/focus-ios#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 <[email protected]>
  • Loading branch information
sryze and isabelrios authored Mar 4, 2024
1 parent 7d61d6a commit 40ee51d
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions focus-ios/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 40ee51d

Please sign in to comment.