Skip to content

fix(mention): Reset mentions array on value clear#254

Open
Hiroenzo wants to merge 1 commit intosadmann7:mainfrom
Hiroenzo:fix/mention-reset-on-value-clear
Open

fix(mention): Reset mentions array on value clear#254
Hiroenzo wants to merge 1 commit intosadmann7:mainfrom
Hiroenzo:fix/mention-reset-on-value-clear

Conversation

@Hiroenzo
Copy link

What the change does:

  1. Monitors input value changes : The effect runs whenever the value or mentions state changes.
  2. Detects empty value state : When the currently selected value is cleared (length === 0) but the mentions array still contains items.
  3. Resets mentions array : Automatically clears the mentions array in this scenario to prevent stale data from persisting.

Why this is necessary:

Previously, if users cleared the currently selected value completely, the mentions array would retain its previous values, leading to inconsistent state and potential unexpected behavior (e.g., mentions still being processed or displayed despite an empty input). This fix ensures the mentions state always reflects the current input context, maintaining data integrity between the currently selected value and associated mentions.

Add effect to reset mentions when input value is cleared
@vercel
Copy link
Contributor

vercel bot commented Jan 13, 2026

@Hiroenzo is attempting to deploy a commit to the sadmann7 Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant