Decathlon / vitamin-ios

Decathlon Design System UI components for iOS & iPadOS applications
https://www.decathlon.design
Apache License 2.0
48 stars 14 forks source link

fix: VitaminTextField rightView animation #94

Closed bcleton closed 2 years ago

bcleton commented 2 years ago

Changes description

We need to set the rightView frame when updating the icon to prevent animation from happening.

Checklist

Does this introduce a breaking change?

Screenshots

iPhone

animation

CLAassistant commented 2 years ago

CLA assistant check
All committers have signed the CLA.

florentlotthepro commented 2 years ago

Thanks @bcleton for your contribution to Vitamin iOS! Could you give us more information about the issue, please? Your gif is the issue that you encounter? Can we replicate it in the showcase app? To approve your fix.

bcleton commented 2 years ago

Yes the gif is the issue i encounter. You can see the animation of the icon (left to right) when i focus the second VitaminTextField. To replicate the issue, i'm not sure but i think you need to have this kind of structure inside a storyboard (i am adding the VitaminTextFIeld directly inside the Storyboard). All the TextFIelds are inside the StackView "FIelds".

Capture d’écran 2022-11-09 à 10 30 33

You then need to set vitaminTextField.activeOnEditing = true. This bug is quite hard to reproduce and doesn't happen every time you focus on a VitaminTextField. You have to do severals tries.

I found the fix on this stackoverflow: https://stackoverflow.com/questions/18853972/how-to-stop-the-animation-of-uitextfield-rightview

florentlotthepro commented 2 years ago

@bcleton Thanks, for the details.

florentlotthepro commented 2 years ago

I let someone else check the pull request and I let you sign our Contributor License Agreement (see CLAassistant message) to merge this PR.

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication