Skip to content

Clicking into a text field selects its whole content #4358

Closed

Description

@AlexAndBear

Initial Checklist

  • I understand this is a bug report and questions should be posted in the Community Discussions
  • I searched issues and couldn’t find anything (or linked relevant results below)

Bug Description

Clicking or tapping into any OcTextInput selects its whole content, so the first key you type replaces the entire value instead of being inserted at the caret. Affects every form using it (user and group edit, space and link names, ...).

Cause: onFocus in packages/design-system/src/components/OcTextInput/OcTextInput.vue calls select() on every focus, mouse and touch included. Selecting everything only makes sense where it's wanted, e.g. the rename and create modals (which use selectionRange).

Reproduction Steps

  1. As admin, open Users and click Edit on a user
  2. Click (or tap) at the end of "First and last name"
  3. Type Y

Expected Outcome

Y is inserted at the caret. Modals that preselect a name (rename, new file/folder) keep doing that.

Actual Outcome

The whole value is selected on focus and replaced by Y.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions