Skip to content

Conversation

Copy link

Copilot AI commented Jun 26, 2025

This PR fixes an issue where users could not highlight/select existing text when renaming clips or boards. Previously, users had to manually delete characters one by one from the end of the text, making editing inefficient and frustrating.

Problem

The onFocus handlers in both ClipEdit.tsx and BoardEdit.tsx only called e.target.select() for new items (when the name was "New Clip" or "New Board"), but not for existing clips/boards with actual names.

Solution

Modified the onFocus handlers to always select all text when the input field receives focus, regardless of whether it's a new item or an existing one with a custom name.

Changes

  • ClipEdit.tsx: Removed conditional check in onFocus handler - now always selects text
  • BoardEdit.tsx: Removed conditional check in onFocus handler - now always selects text
// Before
onFocus={e => {
  if (name === t('New Clip', { ns: 'dashboard' })) {
    e.target.select()
  }
}}

// After
onFocus={e => {
  e.target.select()
}}

This ensures that when users click to rename any clip or board, all existing text is automatically selected, allowing them to easily replace it or modify it as needed.

Fixes #287.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@changeset-bot
Copy link

changeset-bot bot commented Jun 26, 2025

⚠️ No Changeset found

Latest commit: 4e9b1df

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI changed the title [WIP] Unable to Highlight Text When Renaming Clips or Boards Fix text selection when renaming clips and boards Jun 26, 2025
Copilot AI requested a review from kurdin June 26, 2025 17:46
Copilot finished work on behalf of kurdin June 26, 2025 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to Highlight Text When Renaming Clips or Boards

2 participants