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

When does onChange prop get called in React Tagify? #481

Closed
3 tasks done
seanyu4296 opened this issue Apr 24, 2020 · 5 comments
Closed
3 tasks done

When does onChange prop get called in React Tagify? #481

seanyu4296 opened this issue Apr 24, 2020 · 5 comments
Labels
Bug: high priority High priority bug

Comments

@seanyu4296
Copy link

seanyu4296 commented Apr 24, 2020

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://codesandbox.io/s/tagify-react-wrapper-4gkio?file=/src/CrazyTags.js:2696-2704

  • in this example, onChange never gets called. I think the question also is what's the best practice for using Tagify in react

Explanation

  • What is the expected behavior?
    The expected behavior is when data change in the Tags component. onChange gets called so i can create a controlled input based from React's state
  • What is happening instead?
    onChange never seemed to get called
  • What error message are you getting?
    None
@yairEO
Copy link
Owner

yairEO commented Apr 24, 2020

Looking into it

@yairEO yairEO added the Bug: high priority High priority bug label Apr 24, 2020
@yairEO
Copy link
Owner

yairEO commented Apr 24, 2020

I see there is a big problem with recent React changes:

facebook/react#11488

@seanyu4296
Copy link
Author

seanyu4296 commented Apr 25, 2020

Thank you for the fast response. Do you think there is a possible solution that maybe I can help with? I can look into it on Monday. @yairEO

@yairEO yairEO closed this as completed in 2f7db12 Apr 25, 2020
@ruberuvalcaba
Copy link

ruberuvalcaba commented Apr 28, 2020

Hi @yairEO, I noticed that after this update, callbacks are not returning originalInput.value in mix-mode, it is technically the same output string we get on onChange, but it is more consistent at any point when handling data updates on callbacks like keydown, blur, dropdown:select etc

Output:
e.detail.tagify.DOM.originalInput.value: ""

I'd be nice to keep it

@Maazansari
Copy link

Maazansari commented Apr 6, 2021

Hi @yairEO , I am facing issue with values in onChange callback. I am using MixedTags component with custom tag template.
initially tag renders fine. but after changing anything in text-area, Actual value does not return in onChange call back.

Actual value: {my_custom_tag}
Initially render tag:
image

Value After making changes:
image

As you can see value contain next line characters and spaces. If i replace MixedTags with Tag this work perfectly fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: high priority High priority bug
Projects
None yet
Development

No branches or pull requests

4 participants