Skip to content
This repository was archived by the owner on Jun 7, 2020. It is now read-only.

Conversation

@blewjy
Copy link
Contributor

@blewjy blewjy commented Jan 15, 2019

@RocketChat/ios

Closes #2477

This PR address the issue of the UITextField in the connect screen not behaving as expected, where the cursor jumps to the end of the text when editing in the middle of the text.

This problem was mainly caused by the delegate method shouldChangeCharactersIn where the whole text was replaced with every edit. I noticed that this was primarily to trigger the textFieldDidChange() method to toggle the connect button.

My solution was to instead add a listener to the textField for whenever a change was detected, and the handler function being the same textFieldDidChange() method. As a result the shouldChangeCharactersIn method is unused and I have removed it.

Hope my solution is ideal for the problem. Please let me know if there are any changes needed to be made. Thank you! 😊

@CLAassistant
Copy link

CLAassistant commented Jan 15, 2019

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Jan 15, 2019

Codecov Report

Merging #2494 into develop will increase coverage by 0.12%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2494      +/-   ##
===========================================
+ Coverage    26.22%   26.35%   +0.12%     
===========================================
  Files          456      456              
  Lines        16935    16929       -6     
===========================================
+ Hits          4442     4462      +20     
+ Misses       12493    12467      -26
Impacted Files Coverage Δ
...Controllers/Auth/ConnectServerViewController.swift 60.2% <0%> (+1.78%) ⬆️
...ocket.Chat/Extensions/Models/ObjectExtension.swift 80% <0%> (-20%) ⬇️
...ontrollers/Base/Main/MainSplitViewController.swift 45% <0%> (-7.5%) ⬇️
...Chat/Controllers/Chat/MessagesViewController.swift 31.48% <0%> (-2.98%) ⬇️
Rocket.Chat/Managers/PushManager.swift 27.58% <0%> (+3.44%) ⬆️
Rocket.Chat/Managers/AppManager.swift 40.58% <0%> (+4.11%) ⬆️
Rocket.Chat/Extensions/Models/AuthExtensions.swift 100% <0%> (+33.33%) ⬆️
...anagers/Model/AuthManager/AuthManagerRecover.swift 96.96% <0%> (+60.6%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6ee5a3f...33cb393. Read the comment docs.

@rafaelks rafaelks changed the title Add editing changed handler to UITextField in connect screen [IMPROVEMENT] Add editing changed handler to UITextField in connect screen Jan 15, 2019
@rafaelks rafaelks added this to the 3.3.0 milestone Jan 15, 2019
Copy link
Contributor

@rafaelks rafaelks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great! Thank you @blewjy!

@rafaelks rafaelks merged commit dc7176f into RocketChat:develop Jan 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants