[Autocomplete] Allow plugins to be disabled through tom_select_options.plugins.<plugin> = false - #401
Conversation
weaverryan
left a comment
There was a problem hiding this comment.
I like this approach - just one comment
|
@weaverryan Bit off topic but related to solving your feedback: Where can I find information about how to run tests cases etc. I think I am missing a good contribute to symfony/ux page. The part in the readme is very short and is also missing a part about building... |
|
@maartendekeizer that's fair - that could certainly use some help :). To run tests for a specific component, from the root of the project Let me know if that gives you any trouble - the tests can be tricky, but the existing ones in autocomplete should be fairly similar to what you're trying to do. |
|
Friendly ping @maartendekeizer :) |
|
Hey @maartendekeizer is there anything I can help with? 😄 |
|
@weaverryan How should we proceed with this PR? |
|
+1 for a solution for this problem. I'm facing it too and would like to have the PR procceded. |
|
I would vote for merging it to the next release please. We really need the fix. |
|
As the PR seems mergable without conflict, when can we expect this fix to be released? |
|
Working on it |
tom_select_options.plugins.<plugin> = false
📊 Packages dist files size differenceThanks for the PR! Here is the difference in size of the packages dist files between the base branch and the PR.
|
|||||||||
|
I've pushed a new commit that allows default plugins to be disableable when passing <?php
#[AsEntityAutocompleteField]
class IngredientAutocompleteType extends AbstractType
{
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'class' => Ingredient::class,
'tom_select_options' => [
'plugins' => [
'clear_button' => false, // Disable the clear button
'remove_button' => false, // Disable the remove button
],
],
]);
}
public function getParent(): string
{
return BaseEntityAutocompleteType::class;
}
}I added some tests too |
…ns.plugins.<plugin> = false`
|
Thank you @maartendekeizer. |
|
Thank you all. I don't find this in current documentation, but it work. |
When plugins option is defined Symfony UX will no longer add some plugins by default. This make it possible to render a autocomplete without clear button extensions for example.