Skip to content

Allow Relation field (tom-select) to display the dropdown input plugin and clear button by default #2816

Open
@didix16

Description

@didix16

Is your feature request related to a problem? Please describe.
Well I think it's not a problem at all but a user experience improvement. Now, when you have to change the value from a Relation field, you have to type after the already inserted value which is very strange in my opinion and for many of my end users application. Also they don't know if the input can be erased or not. They need to guess that using backspace can erase the content (only if the Relation has marked as allowEmpty, which I think it should be eraseable by default but that's another history)

Describe the solution you'd like
So a solution that I thought is that would be nice to modify the relation_controller.js to add the plugin dropdown-input which displays an input to type explicitly the value you want to search without polluting the final form element and is much clear and intuitive to the final user.

Additionally, I'll also add the 'clear_button' pluggin even if the select has no 'multiple' attribute so the user can see the cross indicating that the value can be erased.

Maybe you could add extra methods to Relation php class that controls those plugins, allowing the developers to choose which options want to be integrated/showed in the form control.

Additional context

imagen

What do you think @tabuna ?

Hope you can make those changes. Thanks in advance

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions