Skip to content

fix: making sure keyboard enabled before typetext() - WPB-19174 #3407

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

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

findms
Copy link
Contributor

@findms findms commented Jul 30, 2025

TaskWPB-19174 [iOS] Fix:keyboard not focused creating issue randomly while typing

Issue

Please describe the issue.

Optional: add details about technical approach, solutions etc.

Optional: reference dependencies to other pull requests etc.

Testing

Describe how to test.

Optional: attachments like images, videos, etc.


Checklist

  • Title contains a reference JIRA issue number like [WPB-XXX].
  • Description is filled and free of optional paragraphs.
  • Adds/updates automated tests.

UI accessibility checklist

If your PR includes UI changes, please utilize this checklist:

  • Make sure you use the API for UI elements that support large fonts.
  • All colors are taken from WireDesign.ColorTheme or constructed using WireDesign.BaseColorPalette.
  • New UI elements have Accessibility strings for VoiceOver.

@findms findms changed the title check keyboard enabled before typetext Making sure keyboard enabled before typetext() - WPB-19174 Jul 30, 2025
@findms findms changed the title Making sure keyboard enabled before typetext() - WPB-19174 fix: Making sure keyboard enabled before typetext() - WPB-19174 Jul 30, 2025
@findms findms changed the title fix: Making sure keyboard enabled before typetext() - WPB-19174 fix: making sure keyboard enabled before typetext() - WPB-19174 Jul 30, 2025
@findms findms marked this pull request as ready for review July 30, 2025 10:48
Copy link
Contributor

github-actions bot commented Jul 30, 2025

Test Results

1 862 tests   1 835 ✅  2m 11s ⏱️
  296 suites     27 💤
    1 files        0 ❌

Results for commit 528d40f.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@netbe netbe left a comment

Choose a reason for hiding this comment

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

left a question before approving

while true {
let hasKeyboardFocus = (value(forKey: "hasKeyboardFocus") as? Bool) ?? false
if hasKeyboardFocus {
break
Copy link
Collaborator

Choose a reason for hiding this comment

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

question: not sure to get the logic, if the keyboard is onfocus we don't type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, in this just make sure the keyboard is enabled and the chain function typeText() perform the type action.

tap()

if Date().timeIntervalSince(startTime) > timeout {
XCTFail("Failed to focus keyboard on element within \(timeout) seconds")
Copy link
Collaborator

Choose a reason for hiding this comment

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

question: does this actually fail? My guess this is not preventing from continuing execution, to check. Alternative would be to throw

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated with throws

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants