-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix for incorrect hover styles for buttons on mobile devices #4623
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH I can't recall many PRs not involving any JS code changes, this one looks nice in this regard 👍 😄
On iOS when you long tap buttons it focuses editable area if editor is not focused yet. And when it's already focused it does nothing (from what I see it's just the way it works there). But for regular tap it's visible there is a transition between hover and active styles. I wonder if we shouldn't adjust the scenario slightly to be not confuisng 🤔
On Android device I have tested with (Android 6.0.1, Chrome 89.0.4389.105) it still works the same as described in #4611:
- Short tap activates the button (with active styles which is fine), but another tab deactivates it with hover styles still visible (one have to tap outside of the editor to make hover styles disappear).
- Long tap activates hover styles but they do not disappear after releasing the finger.
I would be for splitting manual tests to desktop/mobile separately. On smaller screens desktop scenario is hardly visible which may be misleading:
WDYT?
The 2nd thing - I see styles were also updated for richcombo
. Shouldn't we have that covered in a test scenario too?
Did you test in incognito mode? 🤔 It works correctly on my phone with Android, so maybe you hit some issues with cache. As for iOS, I didn't have access to any device and I haven't tested it. I'll need to revisit it later. |
Rechecked and I have the same issue there... 🤔
I mean it seems to be working fine but slightly different than on Android device (long tap does different thing) so maybe rewording test steps would be enough 🤔 Because for the initial scenario described in #4611 the behavior is now correct. |
I've updated manual tests to separate mobile and desktop ones. I've also slightly adjusted mobile ones description to include possible iOS behaviour (yet I don't know how accurate the description is as I don't have access to any iOS device). All tests are now moved to |
Whooops... rebased this PR onto latest major instead of #4461 🤦 🙈 Reverting in progress... |
Thanks @Comandeer 👍 |
Rebased onto latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like Kama skin does not provide active styles for richcombo:
While for moono / moono lisa it looks like:
And also Kama does not provide hover styles for active rich combos... This makes this test scenario hard to describe and follow 🤔 I updated the test scenario but I'm not really happy with how complex it got... @Comandeer maybe you would have a better idea here?
I think it would be better like:
- Check if buttons have hover styles.
- Check if clicking on buttons activate their active state.
- Check if active buttons have hover styles.
- Repeat the procedure for rich combos.
- Repeat the procedure for the second editor.
Then it will be easier to describe expected/unexpected for each step and notes could be placed in better context. WDYT?
As for iOS, long tap focuses the editor (if it's not focused yet) or does nothing if editor is already focused (during the tap, after releasing the button is active - so it works the sam way as regular tap). Hover styles could be seen after releasing the tap, before active styles are added.
So this scenario is kind of confusing / not true... I'm not sure... do you think we should have separate tests for Android and iOS here? Putting everything in a single tests scenario makes it quite complex 🤔
@Comandeer could you try to polish it a bit more?
Ok, so I've completely redesigned tests. There are now divided by:
So now we have 18 tests in total 🙈 But they should be much more readable and understandable. I've also added stricter checking if the test should be run in the current env. It differentiates iOS and Android now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So now we have 18 tests in total But they should be much more readable and understandable.
I've also added stricter checking if the test should be run in the current env. It differentiates iOS and Android now.
A lot of tests and a bit of duplication but indeed seems like the most reasonable approach here 👍 I only fixed spacing in tests (since tab
s doesn't work well with nested "Expected" blocks...).
LGTM 👍 🎉
What is the purpose of this pull request?
Bug fix
Does your PR contain necessary tests?
All patches that change the editor code must include tests. You can always read more
on PR testing,
how to set the testing environment and
how to create tests
in the official CKEditor documentation.
This PR contains
Did you follow the CKEditor 4 code style guide?
Your code should follow the guidelines from the CKEditor 4 code style guide which helps keep the entire codebase consistent.
What is the proposed changelog entry for this pull request?
What changes did you make?
I've used
hover
media query to revert styles on:hover
to the original ones. I've also restored:active
styles after that.I've changed styles for both buttons and rich combos.
Which issues does your PR resolve?
Closes #4611.