discourse/app/assets/javascripts
Mark VanLandingham 64438fff25
FIX: Bind events properly in search-menu.js & fix focus issue (#25006)
The problem:
Removing the options to addEventListener results in events that are properly cleaned up when the search menu is removed. Previously every time you opened the search menu, the listeners would be attached again, and clicking outside even after it was closed would fire the function again and again (N times as you opened the search menu!)

This was made far far worse in this commit c91d053, where I called close() to remove focus from the search input in the event that the search menu is rendered outside the header.

The problem with this was 2-fold. The close function tried to focus the search header button in core here. When the events aren't cleanup up and that happens... you can't do anything in the app.

The solution:
We don't need the event listeners to close the search menu when it's rendered from the header. The widget header handles clicks outside of the header. Sooo

1. Only register them for standalone search menus
2. Remove the passive options to the listeners so that they are properly removed on close
3. Call close() to unfocus input rather than just closing panel
4. Rename passed in are closeSearchMenu -> onClose because it's more accurate. It's really a callback.
2023-12-22 09:48:00 -06:00
..
admin UX: File types site setting (#24976) 2023-12-22 11:23:42 +11:00
bootstrap-json Build(deps-dev): Bump jsdom from 23.0.0 to 23.0.1 in /app/assets/javascripts (#24657) 2023-12-01 11:11:16 +01:00
confirm-new-email
deprecation-silencer
dialog-holder Build(deps): Bump ember-auto-import from 2.7.0 to 2.7.1 in /app/assets/javascripts (#24878) 2023-12-13 22:30:51 +01:00
discourse FIX: Bind events properly in search-menu.js & fix focus issue (#25006) 2023-12-22 09:48:00 -06:00
discourse-common Enable Embroider/Webpack code spliting for Wizard (#24919) 2023-12-20 13:15:06 +00:00
discourse-hbr Build(deps): Bump ember-auto-import from 2.7.0 to 2.7.1 in /app/assets/javascripts (#24878) 2023-12-13 22:30:51 +01:00
discourse-i18n Build(deps): Bump the embroider group (#24391) 2023-11-16 12:31:25 +01:00
discourse-markdown-it Build(deps): Bump ember-auto-import from 2.7.0 to 2.7.1 in /app/assets/javascripts (#24878) 2023-12-13 22:30:51 +01:00
discourse-plugins Build(deps): Bump the babel group in /app/assets/javascripts with 2 updates (#24833) 2023-12-11 22:50:33 +01:00
discourse-widget-hbs Build(deps): Bump ember-auto-import from 2.7.0 to 2.7.1 in /app/assets/javascripts (#24878) 2023-12-13 22:30:51 +01:00
docs
ember-addons
ember-cli-progress-ci
ember-production-deprecations DEV: Only add ember-global deprecation for Ember 3 (#24667) 2023-12-01 14:50:15 +00:00
float-kit Build(deps): Bump ember-auto-import from 2.7.0 to 2.7.1 in /app/assets/javascripts (#24878) 2023-12-13 22:30:51 +01:00
locales
patches DEV: Bump the content-tag patch (#24990) 2023-12-20 18:59:33 +01:00
pretty-text Build(deps): Bump ember-auto-import from 2.7.0 to 2.7.1 in /app/assets/javascripts (#24878) 2023-12-13 22:30:51 +01:00
select-kit Build(deps): Bump ember-auto-import from 2.7.0 to 2.7.1 in /app/assets/javascripts (#24878) 2023-12-13 22:30:51 +01:00
theme-transpiler Build(deps): Bump content-tag from 1.2.1 to 1.2.2 in /app/assets/javascripts (#24955) 2023-12-19 08:58:23 +01:00
truth-helpers Build(deps): Bump ember-auto-import from 2.7.0 to 2.7.1 in /app/assets/javascripts (#24878) 2023-12-13 22:30:51 +01:00
.licensee.json
.npmrc
handlebars-shim.js
package-ember3.json Enable Embroider/Webpack code spliting for Wizard (#24919) 2023-12-20 13:15:06 +00:00
package-ember5.json Enable Embroider/Webpack code spliting for Wizard (#24919) 2023-12-20 13:15:06 +00:00
package.json DEV: Introduce feature-flag for Ember 5 upgrade 2023-11-27 16:40:22 +00:00
polyfills.js
run-patch-package
service-worker.js.erb FIX: Excessive video data downloading from service worker (#24924) 2023-12-15 13:29:50 -07:00
yarn-ember3.lock Enable Embroider/Webpack code spliting for Wizard (#24919) 2023-12-20 13:15:06 +00:00
yarn-ember5.lock Enable Embroider/Webpack code spliting for Wizard (#24919) 2023-12-20 13:15:06 +00:00
yarn.lock DEV: Introduce feature-flag for Ember 5 upgrade 2023-11-27 16:40:22 +00:00