Skip to content

fix: Focus on click #1906

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

Merged
merged 10 commits into from
Apr 8, 2025
Merged

fix: Focus on click #1906

merged 10 commits into from
Apr 8, 2025

Conversation

TatuLund
Copy link
Contributor

@TatuLund TatuLund commented Apr 3, 2025

Mere JS call to click does not focus the element. Real life action of clicking element always focuses it. This is important if in the test story it is important that clicking Button e.g. blurs TextField, which in turn triggers value change in TextField.

@TatuLund TatuLund marked this pull request as ready for review April 3, 2025 07:20
Ansku added a commit that referenced this pull request Apr 3, 2025
(Also remove an unrelated test sysout that shouldn't have been committed
in the first place.)

Based on #1906
Ansku added a commit that referenced this pull request Apr 3, 2025
…#1907)

(Also remove an unrelated test sysout that shouldn't have been committed
in the first place.)

Based on #1906
@mshabarov mshabarov requested a review from mcollovati April 7, 2025 11:36
Copy link
Contributor

@mcollovati mcollovati left a comment

Choose a reason for hiding this comment

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

At a first look, the change seems fine, but I'd like to do some quick tests.
What I do not like is how the getChildrenTest is modified. We are renaming it and adding multiple assertion for different use cases, increasing the maintenance complexity. I would prefer a separated test for the focus handling.

TatuLund and others added 2 commits April 7, 2025 17:07
@TatuLund
Copy link
Contributor Author

TatuLund commented Apr 7, 2025

What I do not like is how the getChildrenTest is modified.

That is about the other PR, but yes I fixed that there.

@mcollovati
Copy link
Contributor

That is about the other PR, but yes I fixed that there.

Great. Let's merge that one and the update this according to the changes

Copy link
Contributor

@mcollovati mcollovati left a comment

Choose a reason for hiding this comment

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

The fix looks good.
I still do not like this clickingButtonWillFocusIt that mixes tests for focus and children and would prefer separated tests.
But the important thing is that we have a test.

@TatuLund
Copy link
Contributor Author

TatuLund commented Apr 8, 2025

I still do not like this clickingButtonWillFocusIt that mixes tests for focus and children and would prefer separated tests.

I was confused what you mean, but now fixed. It was remains of merge conflict.

@TatuLund TatuLund merged commit 27a3232 into main Apr 8, 2025
2 checks passed
@TatuLund TatuLund deleted the focus-on-click branch April 8, 2025 10:26
mshabarov pushed a commit that referenced this pull request Apr 16, 2025
(cherry picked from commit 27a3232)
mshabarov pushed a commit that referenced this pull request Apr 23, 2025
(cherry picked from commit 27a3232)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants