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

Fixed keyboard arrow keys behavior for number fields in AdobeStock grid #26029

Conversation

rogyar
Copy link
Contributor

@rogyar rogyar commented Dec 13, 2019

Description (*)

This PR introduces a fix for keyboard arrow keys in <input type="number"/> of AdobeStock grid.

Technical background

The jsTree (that is used for media gallery directory tree) hotkeys plugin conflicts with <input type="number"/>. The plugin works well with most input types but overtakes keyboard cursors control from the number type. Basically, if we have jsTree with hotkeys plugin enabled and <input type="number"/> on the same page, the keyboard cursor buttons will be handled by jsTree when any of the <input type="number"/> is focused.
If you take a look at the modified file, there were similar "hotfixes" previously but the "number" type has not been taken into consideration.

Fixed Issues (if relevant)

  1. The cursor is not moved in Page Number field with keyboard arrow keys adobe-stock-integration#846 : The cursor is not moved in Page Number field with keyboard arrow keys

Manual testing scenarios (*)

The AdobeStock plugin needs to be installed and configured.

  1. From Magento Admin go to Content - Pages, click Add New Page
  2. Expand Content, click Show / Hide Editor, select Insert Image...
  3. Click Search Adobe Stock
  4. Try to edit the pages field, move the cursor on it and click
    pages field1
  5. Try to move the cursor with left and right arrow keys on the keyboard

The cursor should be moved in order to edit the page number. Please, refer to the original issue to see the "bugged" behavior.

Please note, there's one more issue with arrow keys behavior for input fields that is not connected to the current one somehow. It's fixed in #25991

@rogyar rogyar requested a review from DrewML as a code owner December 13, 2019 14:51
@m2-assistant
Copy link

m2-assistant bot commented Dec 13, 2019

Hi @rogyar. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

@magento-engcom-team magento-engcom-team added Partner: Atwix Pull Request is created by partner Atwix partners-contribution Pull Request is created by Magento Partner labels Dec 13, 2019
@rogyar
Copy link
Contributor Author

rogyar commented Dec 13, 2019

Hi @sivaschenko. Please, take a look at this one when you will have a chance.

Thank you!

@rogyar rogyar assigned rogyar and unassigned rogyar Dec 13, 2019
@rogyar rogyar requested a review from sivaschenko December 13, 2019 14:53
@magento-engcom-team
Copy link
Contributor

Hi @lbajsarowicz, thank you for the review.
ENGCOM-6476 has been created to process this Pull Request
✳️ @lbajsarowicz, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@engcom-Delta engcom-Delta self-assigned this Dec 17, 2019
@engcom-Delta engcom-Delta added the Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests label Dec 17, 2019
@engcom-Delta
Copy link
Contributor

✔️ QA passed

@engcom-Foxtrot engcom-Foxtrot added Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests and removed Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests labels Dec 17, 2019
@engcom-Foxtrot
Copy link
Contributor

@rogyar please cover your fix with unit test.

@engcom-Golf
Copy link
Contributor

@rogyar I think is the best way to cover it with jasmine test, https://devdocs.magento.com/guides/v2.3/test/js/jasmine.html

@sivaschenko
Copy link
Member

@rogyar thanks for the fix! As it was already brought up the code should be covered by tests. I think that MFTF test would work the best for this fix (any grid in magento2 if it's possible to modulate the circumstances causing the bug, otherwise the test can be added to Adobe Stock Integration).

Please let me know if you need help with covering this fix with tests.

@rogyar
Copy link
Contributor Author

rogyar commented Dec 23, 2019

Hi @sivaschenko. Thank you for your suggestion.

In order to test this fix globally, I've created a unit test based on Jasmine instead of MFTF.

@sivaschenko
Copy link
Member

Hi @rogyar thanks for the test, this PR is ready to be approved once Static Tests will be fixed

@rogyar rogyar added Auto-Tests: Covered All changes in Pull Request is covered by auto-tests and removed Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests labels Dec 24, 2019
@rogyar
Copy link
Contributor Author

rogyar commented Dec 24, 2019

Hi @sivaschenko. All green 👌

@magento-engcom-team
Copy link
Contributor

Hi @sivaschenko, thank you for the review.
ENGCOM-6476 has been created to process this Pull Request

@engcom-Delta
Copy link
Contributor

✔️ QA passed

@m2-assistant
Copy link

m2-assistant bot commented Jan 8, 2020

Hi @rogyar, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Lib/Frontend Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Partner: Atwix Pull Request is created by partner Atwix partners-contribution Pull Request is created by Magento Partner Progress: accept Release Line: 2.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants