-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
becomeFirstResponder or focus not working #19
Comments
When you do Please let me know what happens for each of those requests; really helps me debug :) Cheers! |
No keyboard appeared, i'm on iPad devices, the editor view with the decoded html appeard well, but no focus and so no keyboard. I'm using this object only on iPad. I've tried becomeFirstResponder and focus, even focusAt, nohting but the callback richEditorTookFocus is called everytime, so maybe something related to the web part. Could a css could prevent the focus programmatically ? Because it works well when i tap. I don't think there is a way to simulate a tap without UItouch event. |
Or, which could be a bad news, could be related to that : the removal of keyboardDisplayRequiresUserAction not available in WKWebView compare to UIWebView ? Could be a solution ? Because i've event put a RE.focus() at the end of document ready on rich_editor.js and it's called after (breakpoint and js debug fired) but no focus or keyboard shown :( |
ok, it was that ... thx Apple for always breaking everything ;) anyway here some code i've used
and then in setup part
look like it's working here on iPad ios 14.5 :) i don't like private method, but look like there is no other options here, or i didn't look enough on WKWebView docs. |
Thanks for this investigation @Jcragons ! Scratch that: I see: // For iOS 10, *
let sel_10: Selector = sel_getUid("_startAssistingNode:userIsInteracting:blurPreviousNode:userObject:")
// For iOS 11.3, *
let sel_11_3: Selector = sel_getUid("_startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:")
// For iOS 12.2, *
let sel_12_2: Selector = sel_getUid("_elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:")
// For iOS 13.0, *
let sel_13_0: Selector = sel_getUid("_elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:") which is... interesting to say the least. |
Yeah i assume this removal from apple render people crazy since everyone need to move from UIWebView to WKWebView. Didn't try under < ios12 or right now anything else than ipadOs, but i assume it's global. I hope the private method hack will last, look like on ios14 they didn't change method signature, but i'll cross finder at every release ;) I'm not directly using the files from github, but i can check for a PR as soon as i finish my inegration :) |
Hi :) On simulator here on 14.5, i can't get working becomeFirstResponder or focus method. It's working fine with finger tap, showing the keyboard, but programmatically never.
I'm using it inside tableview cell, and try to add a new cell, then show the focus directly, and it's never fired. Look like the method in js is called (with breakpoints) but never get the focus in the simulator.
Any idea or same reaction ? thx !
The text was updated successfully, but these errors were encountered: