Skip to content

Commit

Permalink
Update FluentTextField becomeFirstResponder (#1905)
Browse files Browse the repository at this point in the history
* Add overrides
* Fix lint issue
  • Loading branch information
cmzubrecki authored Sep 28, 2023
1 parent 10dfe5c commit cb47cfb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ios/FluentUI/TextField/FluentTextField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ public final class FluentTextField: UIView, UITextFieldDelegate, TokenizedContro
}
}

@objc public override var canBecomeFirstResponder: Bool {
textfield.canBecomeFirstResponder
}

// Hierarchy:
//
// imageTextStack
Expand Down Expand Up @@ -153,6 +157,13 @@ public final class FluentTextField: UIView, UITextFieldDelegate, TokenizedContro
}
}

@discardableResult
@objc public override func becomeFirstResponder() -> Bool {
let didBecomeFirstResponder = textfield.becomeFirstResponder()
updateState()
return didBecomeFirstResponder
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
Expand Down

0 comments on commit cb47cfb

Please sign in to comment.