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

[bug] TagsInput x button does not trigger "value" callback #369

Closed
ctdunc opened this issue Oct 23, 2024 · 7 comments
Closed

[bug] TagsInput x button does not trigger "value" callback #369

ctdunc opened this issue Oct 23, 2024 · 7 comments
Labels
help wanted Extra attention is needed upstream issue Issue can't be fixed in dmc

Comments

@ctdunc
Copy link

ctdunc commented Oct 23, 2024

Hello,
Noticing that when using TagsInput removing an item with the delete button in the pill does not trigger callbacks taking the value prop as an input. Deleting it with the keyboard does trigger the callback.

Can be seen on the dmc documentation website.

@AnnMarieW
Copy link
Collaborator

Hi @ctdunc

Thanks for reporting - I could also replicate the issue in the docs

@AnnMarieW AnnMarieW added the help wanted Extra attention is needed label Oct 24, 2024
@ctdunc
Copy link
Author

ctdunc commented Oct 24, 2024

Done a bit more testing, I think this is probably my fault, but I'm not sure how I would go about fixing this upstream.

This is new in 0.14.6 and I think related to this commit (which I authored).

I've spent a bit of time messing with it this morning, but need to move on. Here's what I've found that may help someone with fewer skill issues (or more time) get started:

Clicking x on a pill triggers useDidUpdate for selected but not value. Deleting a pill with backspace or adding a pill triggers useDidUpdate for selected and then value. For some reason, it looks whatever is passed to setProps({value: selected}) does not appear to trigger value to actually change when using the delete button from a pill.

Hopefully can revisit this soon

@AnnMarieW
Copy link
Collaborator

Thanks for investigating, this is really helpful!

@AnnMarieW
Copy link
Collaborator

AnnMarieW commented Oct 24, 2024

@ctdunc
dmc 0.14.6 uses Mantine 7.13.2.
The changes you made affected which versions of Mantine? Will the most recent changes fix this issue?

I also verified that this worked in 0.14.5 and broke in 0.14.6 Looks like an upstream issue

@AnnMarieW AnnMarieW added the upstream issue Issue can't be fixed in dmc label Oct 24, 2024
@ctdunc
Copy link
Author

ctdunc commented Oct 25, 2024

I do not believe the most recent changes fix it. I will have to look more closely once i am not traveling.

I think I made one of the classic "dont mutate state directly" blunders upstream trying to fix a different issue in the linked PR. unfortunately for whatever reason the mantine build install is blocked on my companies network so i wasnt able to look at work.

Rolling this back will break the removal of items when duplicates are enabled, but possibly worth?

@AnnMarieW AnnMarieW mentioned this issue Oct 30, 2024
14 tasks
@AnnMarieW
Copy link
Collaborator

Looks like there is a fix in the works mantinedev/mantine#7105 🎉
Thanks @ctdunc !

@AnnMarieW
Copy link
Collaborator

This was fixed in Mantine 7.14.1. I just ran the docs locally with the prerelease version of DMC 0.15.0 and confirmed that it works 🥳

Thanks for your help with this @ctdunc

Closing now :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed upstream issue Issue can't be fixed in dmc
Projects
None yet
Development

No branches or pull requests

2 participants