Restore cursor position on #ajax 'input' or 'keyup' event

Created on 7 April 2019, over 5 years ago
Updated 4 March 2023, almost 2 years ago

When using #ajax with the 'input' event (same with 'keyup') on a text field to replace the field itself, the cursor position is getting lost so the cursor is reset to the beginning of the text field.

It seems rather easy to store and restore the cursor position, see
https://stackoverflow.com/questions/35400504/the-input-elements-cursor-p..., and I think the events' current behavior isn't okay in terms of accessibility, so we should do it.

πŸ› Bug report
Status

Postponed: needs info

Version

10.1 ✨

Component
AjaxΒ  β†’

Last updated 3 days ago

Created by

Pancho UTC+2 πŸ‡ͺπŸ‡Ί EU

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024