Skip to content
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

Focus the context menu after the position is set #25

Merged
merged 2 commits into from
Oct 28, 2019

Conversation

barmac
Copy link
Member

@barmac barmac commented Oct 22, 2019

This fixes the jump of the table when the context menu was opened
in a scrolled table. Previously, the focus was set on a context menu
positioned in the top left corner of the table which forced the browser
to scroll the position to the top left corner. Then, the position
of the context menu was correctly set, but the scroll position
was already changed.

Now, the context menu is positioned correctly first and only then
can it be focused.

Related to camunda/camunda-modeler#1433

@barmac barmac requested a review from philippfromme October 22, 2019 13:45
@bpmn-io-tasks bpmn-io-tasks bot added the needs review Review pending label Oct 22, 2019
This fixes the jump of the table when the context menu was opened
in a scrolled table. Previously, the focus was set on a context menu
positioned in the top left corner of the table which forced the browser
to scroll the position to the top left corner. Then, the position
of the context menu was correctly set, but the scroll position
was already changed.

Now, the context menu is positioned correctly first and only then
can it be focused.

Related to camunda/camunda-modeler#1433
@barmac barmac force-pushed the first-position-the-context-menu-and-then-focus-it branch from 5ebb4c3 to 0f7708f Compare October 22, 2019 13:45
@barmac barmac changed the title fix(context-menu): focus the context menu only the position is set fix(context-menu): focus the context menu after the position is set Oct 22, 2019
@barmac barmac changed the title fix(context-menu): focus the context menu after the position is set Focus the context menu after the position is set Oct 22, 2019
@barmac
Copy link
Member Author

barmac commented Oct 22, 2019

Thank you 🦊

@barmac
Copy link
Member Author

barmac commented Oct 22, 2019

This, this and this seem to be related to the 🦊 failure.

@barmac barmac force-pushed the first-position-the-context-menu-and-then-focus-it branch 2 times, most recently from c144f27 to 0f7708f Compare October 23, 2019 08:45
@barmac
Copy link
Member Author

barmac commented Oct 23, 2019

I looked more into this and it seems that the Firefox test failure is caused by a bug in the browser. Even with Firefox 70 the test fails. On the other hand, the bug is gone when tested manually.

@nikku
Copy link
Member

nikku commented Oct 23, 2019

If that is the case we could exclude the failing spec on Firefox.

This should be a rare thing to do. And please document it / link to related issues you've found along with the skip.

barmac added a commit that referenced this pull request Oct 23, 2019
Firefox inconsistently fires focus events which causes the tests
to fail but in real usage autofocus works correctly.

Cf. #25 and linked sources
@barmac barmac force-pushed the first-position-the-context-menu-and-then-focus-it branch from 2672e39 to f29287d Compare October 23, 2019 09:34
Firefox inconsistently fires focus events which causes the tests
to fail but in real usage autofocus works correctly.

Cf. #25 and linked sources
@barmac barmac force-pushed the first-position-the-context-menu-and-then-focus-it branch from f29287d to 6e21af2 Compare October 23, 2019 09:48
@barmac
Copy link
Member Author

barmac commented Oct 23, 2019

@philippfromme Firefox will no more test the cases where it failed to focus correctly. Please feel free to review now.

Copy link
Contributor

@philippfromme philippfromme left a comment

Choose a reason for hiding this comment

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

👏

@fake-join fake-join bot merged commit b814649 into master Oct 28, 2019
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Oct 28, 2019
@fake-join fake-join bot deleted the first-position-the-context-menu-and-then-focus-it branch October 28, 2019 08:34
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.

3 participants