Make WordPress Core

Opened 20 months ago

Closed 16 months ago

Last modified 9 months ago

#63126 closed enhancement (fixed)

Theme preview model and Media library model having issues with Shift/Ctrl + Shift next and previous arrows.

Reported by: praful2111 Owned by: joedolson
Priority: normal Milestone: 6.9
Component: Themes Version: 6.7.2
Severity: normal Keywords: has-patch has-test-info commit
Cc: Focuses: accessibility

Description

When we open the theme preview model and try to select text using the Shift/Ctrl+Shift with a left and right arrow then the theme modal switches the theme instead of the selecting text.

Screen recording - ​https://www.awesomescreenshot.com/video/37791980

Attachments (3)

63126.patch​ (903 bytes ) - added by praful2111 20 months ago.
Patch added
63126.2.patch​ (903 bytes ) - added by praful2111 20 months ago.
Patch added
63126-theme-and-edit-attachments.patch​ (1.5 KB ) - added by hiteshtalpada 20 months ago.
Added theme and media library model patch

Download all attachments as: .zip

Change History (23)

#1 @praful2111
20 months ago

  • Keywords has-patch added; needs-patch removed

#3 @hiteshtalpada
20 months ago

  • Keywords has-testing-info added

Test Report

Description

This report validates whether the indicated patch works as expected.

Patch tested: https://core.trac.wordpress.org/attachment/ticket/63126/63126.patch

Environment

  • WordPress: 6.8-beta3-60042-src
  • PHP: 8.2.25
  • Server: nginx/1.27.2
  • Database: mysqli (Server: 8.4.2 / Client: mysqlnd 8.2.25)
  • Browser: Chrome 134.0.0.0
  • OS: Linux
  • Theme: Twenty Twenty-Five 1.1
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  1. ✅ Issue resolved with patch.

#4 @joemcgill
20 months ago

  • Milestone Awaiting Review → 6.9

Hi @praful2111. Thanks for the report and for including a patch!

I can reproduce the issue and confirmed that this was existing behavior in 6.7. Given that we're so close to the release deadline for 6.8, I'm adding this to the 6.9 milestone for consideration.

This ticket was mentioned in ​Slack in #accessibility by joedolson. ​View the logs.


20 months ago

#6 @joedolson
20 months ago

  • Owner set to joedolson
  • Status new → accepted

The same issue occurs in the media library modal. We can probably resolve both in this ticket; but if it proves to be a significantly different solution, we should open a separate ticket.

#7 @hiteshtalpada
20 months ago

  • Summary Theme preview model having issues with Shift/Ctrl + Shift next and previous arrows. → Theme preview model and Media library model having issues with Shift/Ctrl + Shift next and previous arrows.

Hi @joedolson Thanks for pointing that out!

I've created a patch that should resolve the issue in the media library model.

#8 @wordpressdotorg
18 months ago

  • Keywords has-test-info added; has-testing-info removed

This ticket was mentioned in ​Slack in #accessibility by joedolson. ​View the logs.


18 months ago

#10 in reply to: ↑ description @nazmul111
18 months ago

Replying to praful2111:

Screen recording - ​https://www.awesomescreenshot.com/video/37791980

screen recording not found. You are requested to check.

This ticket was mentioned in ​Slack in #core-test by boniu91. ​View the logs.


18 months ago

#12 @sandeepdahiya
17 months ago

  • Keywords needs-unit-tests added

Bug Reproduction and Test Report

Description

✅ This report validates that the bug exists as reported and the indicated patch works as expected.

Patch tested: 63126-theme-and-edit-attachments.patch

Environment

  • WordPress: 6.9-alpha-60093-src
  • PHP: 8.2.28
  • Server: nginx/1.27.5
  • Database: mysqli (Server: 8.4.5 / Client: mysqlnd 8.2.28)
  • Browser: Firefox 139.0
  • OS: Windows 10/11
  • Theme: Twenty Twenty-Five 1.2
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  1. 🐞 Bug reproduction: Log in to the WordPress dashboard, go to Appearance → Themes, click on any theme, and try selecting text using the mouse. Then use (Shift + →) or (Ctrl + Shift + →).You’ll notice that instead of selecting the text, WordPress navigates to the next theme preview. The same issue occurs in the Media Library as well.
  1. ✅ Test results: Issue resolved with patch. (Shift + →) or (Ctrl + Shift + →) selects the next instead of moving to the next item. and pressing → key only takes you to the next item.

Additional Notes

This ticket was mentioned in ​PR #9014 on ​WordPress/wordpress-develop by ​@abcd95.


17 months ago
#13

This PR prevents theme preview and media library modals from interfering with text selection keyboard shortcuts.

When using Shift+Arrow or Ctrl+Shift+Arrow to select text in modal descriptions, the modal would capture the arrow keys and navigate to next/previous items instead of allowing text selection. This unexpected behavior prevented users from efficiently editing text.

Added tests to verify the logic to ignore arrow key events when Shift or Ctrl+Shift modifiers are pressed, allowing default text selection behavior.

Follows Patch: https://core.trac.wordpress.org/attachment/ticket/63126/63126-theme-and-edit-attachments.patch

#14 @abcd95
16 months ago

  • Keywords needs-unit-tests removed

​@joedolson commented on ​PR #9014:


16 months ago
#15

I briefly considered whether the tests should use event.code or event.key instead of the deprecated event.keyCode, but decided that it makes more sense to keep the tests using the same references used in the actual code, and changing those over should be a separate task.

#16 @joedolson
16 months ago

  • Keywords commit added

#17 @joedolson
16 months ago

  • Resolution → fixed
  • Status accepted → closed

In 60516:

General: Prevent Media & Theme modals from events on modified arrow keys.

Change the left and right arrow key navigation used in the Theme and Media modal interfaces so the events don't fire when shift or ctrl are also pressed.

Includes tests.

Props praful2111, hiteshtalpada, joemcgill, sandeepdahiya, abcd95, joedolson.
Fixes #63126.

#18 @jonsurrell
9 months ago

I believe [60516] omitted the new test file. ​See PR 10847.

#19 @jonsurrell
9 months ago

In 61625:

Build/Test Tools: Add theme keyboard navigation tests.

Add the theme keyboard navigation test file that omitted from [60516].

Follow-up to [60516].

Props abcd95, jonsurrell, mukesh27.
See #64225, #63126.

#20 @westonruter
9 months ago

In 61629:

Coding Standards: Use tabs for indentation and remove trailing line whitespace in QUnit test.

Follow-up to [61625], [60516].

See #63126.

Note: See TracTickets for help on using tickets.