notchris / payload-mask-plugin

An input mask plugin for Payload
https://www.npmjs.com/package/payload-mask-plugin
MIT License
5 stars 0 forks source link

Mask field is always dirty #1

Closed mfilteau closed 1 month ago

mfilteau commented 2 months ago

Editing a collection with a mask text field causes the collection document to be marked as dirty. Payload will ask if we want to stay on the page or discard the changes.

The problem lies in the onAccept callback that is triggered when the field value is loaded.

Here's how I fix it:

onAccept={newValue => newValue !== value && setValue(newValue)}
notchris commented 2 months ago

@mfilteau So sorry I just saw all of these issues, I was on vacation. I will try to resolve them this week.

mfilteau commented 2 months ago

@notchris No worries!

notchris commented 1 month ago

This should be fixed now!