symfony / ux

Symfony UX initiative: a JavaScript ecosystem for Symfony
https://ux.symfony.com/
MIT License
856 stars 315 forks source link

[Autocomplete] Support `labelField` options #2375

Open MatTheCat opened 1 week ago

MatTheCat commented 1 week ago

I’m currently using a DTO to store entities data besides their text and value in TomSelect options. I wanted its properties to match our model; e.g. by setting valueField to id I can make TomSelect use the DTO’s $id property to populate options’ value. This works great, but not for labelField because its default value (text) is hardcoded in score, render.item and render.option.

Would it be possible to make this property depends on the labelField option? Thanks!