alpinejs / alpine

A rugged, minimal framework for composing JavaScript behavior in your markup.
https://alpinejs.dev
MIT License
27.92k stars 1.22k forks source link

Adds `x-data` to `x-mask` documentation #4326

Open tjbarber opened 1 month ago

tjbarber commented 1 month ago

Spent more time than I'd like to admit trying to add x-mask to a field just to have it do nothing. It wasn't until I found this discussion that I realized that I was missing x-data which wasn't mentioned in the docs for this plugin.

I think it makes sense to highlight to the user that this is required, either with something like this or an alert near the top of the page.

ekwoka commented 1 month ago

The way this is done introduces the possibility of the opposite mis understanding now, where the reader thinks that x-data is always required.

Perhaps following how this pr https://github.com/alpinejs/alpine/pull/4307 handles it is acceptable?

tjbarber commented 1 month ago

I would say that would be acceptable if your alert was also on x-mask documentation!