Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

fix(autocomplete): Allow clicks inside md-not-found. #5564

Closed
wants to merge 1 commit into from

Conversation

topherfangio
Copy link
Contributor

Fix bug causing the autocomplete to blur, lose focus, and hide the not found message if the user attempted to click the not found message (or a link inside of it).

Fixes #5424.

Fix bug causing the autocomplete to blur, lose focus, and
hide the not found message if the user attempted to click
the not found message (or a link inside of it).

Fixes #5424.
@topherfangio topherfangio added the needs: review This PR is waiting on review from the team label Nov 4, 2015
@@ -359,8 +359,8 @@ function MdAutocompleteCtrl ($scope, $element, $mdUtil, $mdConstant, $mdTheming,
* Handles input blur event, determines if the dropdown should hide.
*/
function blur () {
hasFocus = false;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robertmesserle Can you think of any reason why the hasFocus was outside of the if statement? All tests pass after moving it and my manual testing didn't show any differences except that it fixed my bug.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is so that we know when the element lost focus so that we can refocus when they leave the dropdown. This was related to ie 11.

Sent from my iPhone

On Nov 4, 2015, at 3:43 PM, Topher Fangio notifications@github.com wrote:

In src/components/autocomplete/js/autocompleteController.js:

@@ -359,8 +359,8 @@ function MdAutocompleteCtrl ($scope, $element, $mdUtil, $mdConstant, $mdTheming,
* Handles input blur event, determines if the dropdown should hide.
*/
function blur () {

  • hasFocus = false;
    @robertmesserle Can you think of any reason why the hasFocus was outside of the if statement? All tests pass after moving it and my manual testing didn't show any differences except that it fixed my bug.


Reply to this email directly or view it on GitHub.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I restored it:

  function blur () {
    hasFocus = false;
    if (!noBlur) {
      ctrl.hidden = shouldHide();
    }
  }

@ThomasBurleson
Copy link
Contributor

@topherfangio - what is the status of this PR ?

@ThomasBurleson
Copy link
Contributor

Fixed with SHA 5ae3d4c

@topherfangio topherfangio deleted the team/topher/fix-autocomplete-click-5424 branch December 17, 2015 20:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: review This PR is waiting on review from the team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants