Skip to content

hashtag autocomplete: close menu on blur #2

Closed
@ryanflorence

Description

@ryanflorence

Currently the twitter hashtag popover stays open even when the input is blurred. I've implemented a solid menu blur by:

  1. focusing the menu when the user starts navigating (will need set tabindex=-1 for this)
  2. adding blur handlers to the input and the menu
  3. in the handler determine if document.activeElement is the either the input, the menu, or a child of the menu
  4. if not, close the menu

You can't do a typical "outerclick" because:

  1. that doesn't handle keyboard navigation (tab away from the input)
  2. <select> tags don't propogate events up to the body.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions