Implemented that on tap on label also password visibility gets toggled
This commit is contained in:
parent
c037308751
commit
c5cf11e8fc
|
@ -101,6 +101,10 @@ struct UIKitTextField: UIViewRepresentable {
|
||||||
if focusTextField {
|
if focusTextField {
|
||||||
DispatchQueue.main.async { // in very few cases focusTextField gets called during view update resulting in 'undefined behavior' -> async() fixes this
|
DispatchQueue.main.async { // in very few cases focusTextField gets called during view update resulting in 'undefined behavior' -> async() fixes this
|
||||||
uiView.focus()
|
uiView.focus()
|
||||||
|
|
||||||
|
if isPasswordField { // TODO: currently it works but focusTextField can in general also be set in other ways then by tapping on label
|
||||||
|
context.coordinator.togglePasswordVisibility()
|
||||||
|
}
|
||||||
|
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
self.focusTextField = false // reset value so that it can be set again (otherwise it may never gets resetted and then updateUIView() requests focus even though already another view got the focus in the meantime)
|
self.focusTextField = false // reset value so that it can be set again (otherwise it may never gets resetted and then updateUIView() requests focus even though already another view got the focus in the meantime)
|
||||||
|
|
Loading…
Reference in New Issue