ziffmedia / nova-select-plus

A Laravel Nova Select Field
MIT License
95 stars 26 forks source link

Feature request: support for HTML attributes using "withMeta" and "extraAttributes" #18

Closed samnau closed 4 years ago

samnau commented 4 years ago

Since this isn't a feature that Nova's out-of-the-box Select fields support, this would be a useful feature to allow developers to set HTML attributes on Nova Select fields without creating a custom field component set.

ralphschindler commented 4 years ago

Can you give me a use case in code of how you might use this?

samnau commented 4 years ago

Mostly for adding data attributes to input fields without having to create custom fields with the Nova CLI. Data decorators that I could read on the front-end for custom Vue components to consume. And also just because it seems like if Text fields can have extra attributes in their HTML markup, why can't Selects?

ralphschindler commented 4 years ago

Please see v1.0.8 to see if html based labels can do what you want.

https://github.com/ziffmedia/nova-select-plus/blob/master/readme.md#-labelstringclosure-attribute-pick-a-different-attribute-to-use-as-the-label

Beyond that, I need some help understanding your use case a little better with code samples, we can reopen at a later date if we have something more concrete to consider.