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

tagData.__isValid__= false or tagData.__isValid= false does not make tag invalid as suggested on issue #474 #1047

Closed
3 tasks done
jrp99 opened this issue Jun 9, 2022 · 2 comments

Comments

@jrp99
Copy link

jrp99 commented Jun 9, 2022

Prerequisites

  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed

💥 Demo Page

https://jsbin.com/zasuqir/edit?html,js,console,output

Explanation

  • What is the expected behavior?
    Basically I'm using this to input emails for a referral invite. I want to validate on add tag thru ajax but I encountered an issue on changing a tag from valid to invalid without using the validate setting. I saw on issue #474 to set it to tagData.__isValid__= false but it looks like it changed to __isValid instead. I expect the tag when added to be invalid if the email already exists. On the demo page you can use test2@email.com as a test for the add event and test3@email.com for transformTag.

  • What is happening instead?
    I tried both tagData.__isValid__= false and tagData.__isValid= false using a condition on add event and transformTag but it still doesn't change the tag to invalid but on the console it changed to false already.

  • What error message are you getting?
    Unfortunately there is no error message.

@yairEO
Copy link
Owner

yairEO commented Jun 22, 2022

Hi, tagData.__isValid__ never existed, it was always just tagData.__isValid. What you saw was a mistake in my comment there (which I now edited).

You cannot set tagData.__isValid within transformTag because Tagify will ignore it. It should be handled within the validate setting. Why would you do validation within transformTag and not within the validate method?

https://jsbin.com/rojixul/edit?js,output

@jrp99
Copy link
Author

jrp99 commented Jun 24, 2022

Thank you the example you gave worked for my case! I do however have an issue with the keepInvalidTags setting when it is true. For some reason, the invalid tag thru ajax becomes valid again when I remove a valid tag. Here is the jsbin for it

https://jsbin.com/furoder/edit?html,js,console,output

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

No branches or pull requests

2 participants