-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
Missconception while adding new chips [Bug]: #439
Comments
I dont understand where a bug is. I looked into the code and it is clear what you can do. As far as I see, you are not doing any validation step between input-field and addChip. Instead the input-data is directly connected to the addChip() Method. This could cause many issues and is not a very good practice. It would make sense to have an additional validation step between, before putting data to the addChip Method. In this step you can check if the input-data is null for example and then not add a chip. For now it is allowed to put any data for the id. The validation has to be done externally/manually because we dont know if someone wants to use numbers as Ids too or any other datatype. I intentionally left this open and flexible, because the validation and search functions should be customizeable and cover many usecases. A potential solution I could live with, can be:
But this is a feature then. Any suggestions? |
It would be awesome if you could provide some additional test-cases for this types of scenarios. |
Hi! I am very grateful for your reply. The fact is that I am making a tag system where I allow the user to add new tags, in a way as indicated in the documentation. But the fact is that I noticed that when adding a new tag, information is transferred from the input field to it, but not to the paramert TEXT, but to the ID parameter, (this.addChip({ id: this._input.value }); LINE 2733) and when this information is sent to the backend, logic is violated. Because the entered value is expected in the TEXT field. In this case, the ID field must be NULL, because this "Chip" does not yet have its own ID, and it must be assigned by the backend. |
Before submitting...
Context
In a case of ADDING new Chips you assign "Input text" to an ID of new chip. Wich is breaking logick of 2.0.0 chip data structure
Current Behavior
Expected behavior
while adding new chips i expect to get the same structure of chips data similar to rest of framework
Possible Solutions or Causes
as I mentioned this.addChip({ id: null, text: this._input.value });//INSTEAD this.addChip({ id: this._input.value }); LINE 2733
also fix some functions checking validity of chips which is not allowed chip without id. It is possiblw while chip didnt get an id from database
Steps to reproduce
No response
Your Environment
English is not my native language, sorry
The text was updated successfully, but these errors were encountered: