futil-js / contexture-react

React components for building contexture interfaces
https://smartprocure.github.io/contexture-react
MIT License
6 stars 4 forks source link

Fix maxTags checking #501

Closed Akrion closed 3 years ago

Akrion commented 3 years ago
decrapifier commented 3 years ago
Warnings
:warning: The README has not been updated. Please update the README.
Messages
:book: Could not find any browser results.
:book: You reduced the total lines of code! Awesome! :+1:

Generated by :no_entry_sign: dangerJS against 83ce8a14605eeed597623993adc4b5296698fb7a

Akrion commented 3 years ago

I don't follow. Why is the max tags handling being moved from TagsInput to TagsQuery?

The way we had it before was not correct since no matter what you do in terms of tags sanitizing etc we simply appended what was before with what was just added ... so max was broken if you add the tags in multiple copy/paste etc.

With the current approach, we always limit the total tags and those are then stamped on the tree. Also, TagsQuery is the one now calling the onTagsDropped and there was no need to pass that and maxTags down to TagsInput ... We also only care about the maxTags limit in the context of the TagsQuery really ... in the other cases (unless I am missing something) we do not really need it.

stellarhoof commented 3 years ago

We also only care about the maxTags limit in the context of the TagsQuery really ... in the other cases (unless I am missing something) we do not really need it.

This makes sense. It's a questionable feature for the generic TagsInput.