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

[5.x]: Routes Overlay: input field not working properly after adding a token #14884

Closed
olsp opened this issue Apr 27, 2024 · 2 comments
Closed
Assignees
Labels

Comments

@olsp
Copy link

olsp commented Apr 27, 2024

What happened?

Description

When adding/editing a route via the CP it's difficult to add text after adding a token. One needs to click right next to the token for being able to add text after it. Otherwise the caret is positioned at the start.

Steps to reproduce

  1. Click on "Add route"
  2. Add a token
  3. try to focus the input field again by clicking in the right part of it (not close to the token)

Expected behavior

The input field should be focusable no matter where you click inside the field

Actual behavior

The caret moves to the very left of the input field. If you want to set it after the tag, you need to click next to the tag, not more than some pixels right of it.

Here is a video of it:
https://github.com/craftcms/cms/assets/1073442/0c6a1ee9-7b8a-4cec-aae7-0a393818456c

Craft CMS version

5.0.5

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

@olsp olsp added the bug label Apr 27, 2024
brandonkelly added a commit that referenced this issue Apr 29, 2024
@brandonkelly brandonkelly self-assigned this Apr 29, 2024
@brandonkelly
Copy link
Member

Thanks for pointing that out!

Just made a few improvements for Craft 4.9 and 5.1:

  • Clicking anywhere to the right of the text will move the focus to the end of the text
  • Pressing Ctrl/Command + / anywhere within the URI input will move focus all the way to the beginning/end of the input. (Previously it would only move to the beginning/end of the selected text node, or default to the browser’s Back/Forward navigation if a token was selected.)
  • Fixed a focus bug that could occur when the modal was first opened.

@brandonkelly
Copy link
Member

brandonkelly commented Apr 30, 2024

Craft 4.9 and 5.1 are out now with those changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants