Skip to content

[Bug]: a form "change" event is fired on blur, when the value did not change #894

Open
@lovasoa

Description

@lovasoa

Bug description

When the tom select field is blurred, tom select reinitilizes it to an empty state, but still lets a change event bubble up the DOM, while the <select> element value is still the user's search string (that did not match any valid option).

Screencast.From.2025-02-27.15-24-57.mp4

Expected behavior

When the input field is reinitialized, and it was originally empty, then the value did not change, and no change event should bubble up to the parent form component.

Steps to reproduce

  1. Go to https://codepen.io/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-/pen/gbOLKKv?editors=1011
  2. Start typing something in the input
  3. Click outside the input

Additional context

  • OS: all
  • Browser all
  • Version latest
  • Device: all

Activity

lovasoa

lovasoa commented on Feb 27, 2025

@lovasoa
Author

initially reported in sqlpage/SQLPage#832

lovasoa

lovasoa commented on Feb 27, 2025

@lovasoa
Author

Maybe the additional <input> element that tom-select creates to handle user input should not be linked to the same <form> element as the actual <select> that contains the real values selected by the user.

github-actions

github-actions commented on Jun 28, 2025

@github-actions

This issue has not been active in 120 days and has been marked "stale". Remove stale label or comment or this will be closed in 15 days

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleNo activity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @lovasoa

        Issue actions

          [Bug]: a form "change" event is fired on blur, when the value did not change · Issue #894 · orchidjs/tom-select