Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

🐛 Fixed search losing focus when removing search term #883

Merged
merged 1 commit into from
Oct 3, 2017

Conversation

kevinansfield
Copy link
Member

@kevinansfield kevinansfield commented Oct 2, 2017

closes TryGhost/Ghost#9075

  • ensure we re-focus the input element after closing the dropdown so that it's not necessary to click on the search input again after using backspace
  • removes unnecessary use of run.scheduleOnce
    • this was causing the error in Deleting search query causes error Ghost#9075 because search was happening out of sync with the open/close of the dropdown in turn causing ember-basic-dropdown to try measuring non-existent elements
    • alternative fix would be to wrap each open/close, focus, and search call in separate run.scheduleOnce('afterRender', ...) calls
  • remove use of invokeAction, it's not been necessary in Ember for a while now and we should be calling methods directly where possible for easier debugging

closes TryGhost/Ghost#9075
- ensure we re-focus the input element after closing the dropdown so that it's not necessary to click on the search input again after using backspace
- removes unnecessary use of `run.scheduleOnce`
  - this was causing the error in TryGhost/Ghost#9075 because search was happening out of sync with the open/close of the dropdown in turn causing `ember-basic-dropdown` to try measuring non-existent elements
  - alternative fix would be to wrap each open/close, focus, and search call in separate `run.scheduleOnce('afterRender', ...)` calls
- remove use of `invokeAction`, it's not been necessary in Ember for a while now and we should be calling methods directly where possible for easier debugging
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) to 72.276% when pulling ce8695f on kevinansfield:fix-search-deletion into 2792104 on TryGhost:master.

@aileen
Copy link
Member

aileen commented Oct 3, 2017

LGTM 👍

@aileen aileen merged commit 75c5a02 into TryGhost:master Oct 3, 2017
@kevinansfield kevinansfield deleted the fix-search-deletion branch June 4, 2018 10:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deleting search query causes error
3 participants