Skip to content

Commit b060bf6

Browse files
committed
bug #570 [Autocomplete] Setting preload back to "focus" as the default (weaverryan)
This PR was merged into the 2.x branch. Discussion ---------- [Autocomplete] Setting preload back to "focus" as the default | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | Tickets | None | License | MIT Hi! In 2.6.0, #539 accidentally changed the `preload` behavior from `focus` to `false`. The result is that, in 2.5.0, clicking on an autocomplete field will instantly make an Ajax call to load options. But in 2.6.0, clicking on it does nothing, until you type a few characters. This changes back to the old default, which I like better, and also (maybe more importantly) is the previous behavior. Cheers! Commits ------- 04cc08f Setting preload back to "focus" as the default
2 parents f174955 + 04cc08f commit b060bf6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Autocomplete/doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ to the options above, you can also pass:
248248
``max_results`` (default: 10)
249249
Allow you to control the max number of results returned by the automatic autocomplete endpoint.
250250

251-
``preload`` (default: ``false``)
251+
``preload`` (default: ``focus``)
252252
Set to ``focus`` to call the ``load`` function when control receives focus.
253253
Set to ``true`` to call the ``load`` upon control initialization (with an empty search).
254254

src/Autocomplete/src/Form/AutocompleteChoiceTypeExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function configureOptions(OptionsResolver $resolver)
9898
'no_more_results_text' => 'No more results',
9999
'min_characters' => 3,
100100
'max_results' => 10,
101-
'preload' => false,
101+
'preload' => 'focus',
102102
]);
103103

104104
// if autocomplete_url is passed, then HTML options are already supported

0 commit comments

Comments
 (0)