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

Notice for max item limit is removed permanently if you keep typing #1201

Open
mc906 opened this issue Sep 9, 2024 · 3 comments
Open

Notice for max item limit is removed permanently if you keep typing #1201

mc906 opened this issue Sep 9, 2024 · 3 comments
Assignees
Labels

Comments

@mc906
Copy link

mc906 commented Sep 9, 2024

Describe the bug
The element that shows the message Only ${maxItemCount} values can be added after the item limit is reached disappears too early and cannot be triggered again. After the limit is reached, if you type one character the message is shown in the dropdown. If you type one or more extra characters, the element is removed completely and permanently (unless you reload the page). It does not re-appear after deleting the text and typing again, or after leaving and re-entering the input. The issue occurs with type text and type select-multiple.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://choices-js.github.io/Choices/
  2. Go to the first example under Text inputs.
  3. Add items until the limit of 5 is reached.
  4. Type one character to make the notice Only 5 values can be added appear.
  5. Type another character to make the same notice disappear.

Expected behavior
I would expect that the notice stays even if you type more than one character and that it re-appears if you clear the search input and make another attempt of adding or searching an item.

Screenshots
Not applicable.

Choices version and bundle

  • Version: v11.0.2

Desktop (please complete the following information):

  • OS: Ubuntu 22.04
  • Browser: Firefox
  • Version: 130

Smartphone (please complete the following information):
Not applicable.

Additional context
None.

@mc906 mc906 added the bug label Sep 9, 2024
@Xon Xon self-assigned this Sep 10, 2024
@Xon
Copy link
Collaborator

Xon commented Sep 11, 2024

I will look into this early next week, as it looks like the logic on when or what a notice gets added needs more work.

@mc906
Copy link
Author

mc906 commented Sep 11, 2024

Thank you! 🙂

@markbiegel
Copy link

I don't have time to create a PR for this, however if you throw a this._renderNotice(); before the early return for displayNotice it will solve the issue.

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

3 participants