diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2020-07-24 12:29:20 +0000 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2020-07-27 08:24:30 +0000 |
| commit | dafe96b3da12795506ddec9cc4d54e226af92a06 (patch) | |
| tree | 972306f89ae1cf4590027b2dc5186dfa9378a69d /addons/website_links | |
| parent | eab8795c4ecaf124471b929a3d8257a3746e6ba5 (diff) | |
[FIX] website_links: prevent display of huge list
- Create 80k UTM sources
- Go to the Website
- Promote a page (e.g. an event)
- Select a source
The web browser freezes.
It happens because Select2 tries to display all sources at once.
To prevent this, we force at least 3 characters before searching and
hence displaying the results. Note that a such high number of UTM
sources is reached because of automatic generation of random values in
mass mailing. Therefore, the combination of 3 characters narrows down
the search result drastically.
opw-2289249
closes odoo/odoo#54947
X-original-commit: 7c7986361704d7b82b115499e64c47eb74ab655f
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons/website_links')
| -rw-r--r-- | addons/website_links/static/src/js/website_links.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/addons/website_links/static/src/js/website_links.js b/addons/website_links/static/src/js/website_links.js index d897b3da6b8..f1701005a78 100644 --- a/addons/website_links/static/src/js/website_links.js +++ b/addons/website_links/static/src/js/website_links.js @@ -58,6 +58,7 @@ var SelectBox = publicWidget.Widget.extend({ createSearchChoicePosition: 'bottom', multiple: false, data: self.objects, + minimumInputLength: self.objects.length > 100 ? 3 : 0, }); }, |
