Skip to content

Conversation

@kylebuch8
Copy link
Contributor

@kylebuch8 kylebuch8 commented Aug 18, 2020

Fixes #1045

pfe-autocomplete

Our analytics teams have requested a custom event to be fired when the pfe-autocomplete dropdown is shown to a user. They need this to help track the usage of the component. This pull request fires a pfe-autocomplete:options-shown event when the dropdown is shown to the user.

Related issue

Preview

Link(s) to demo page(s) where this element can be viewed:

Testing instructions

  1. Go to the demo page
  2. Add the following code block in the developer tools console
const pfeAutocomplete = document.querySelector("pfe-autocomplete");
pfeAutocomplete.addEventListener("pfe-autocomplete:options-shown", e => console.log(e));
  1. Enter the letter "i" into the first input field
  2. Validate that the pfe-autocomplete:options-shown event fired

Browser requirements

Your component should work in all of the following environments:

  • Latest 2 versions of Edge
  • Internet Explorer 11 (should be useable, not pixel perfect)
  • Latest 2 versions of Firefox (one on Mac OS, one of Windows OS)
  • Firefox 68 (or latest version for Red Hat Enterprise Linux distribution)
  • Latest 2 versions of Chrome (one on Mac OS, one of Windows OS)
  • Latest 2 versions of Safari
  • Android mobile device (such as the Galaxy S9)
  • Apple mobile device (such as the iPhone X)
  • Apple tablet device (such as the iPhone Pro)

Ready-for-merge Checklist

Check off items as they are completed. Feel free to delete items if they are not applicable.

  • Expected files: all files in this pull request are related to one request or issue (no stragglers or scope-creep).
  • Tests have been updated to cover these changes.
  • Browser testing passed.
  • Repository compiles and tests pass.
  • Changelog updated (not needed for documentation updates).
  • Documentation (README.md, WHY.md, etc.) updated or added.
  • Link to the demo recording:
  • Approved by designer.

Merging

Please squash when merging and ensure your commit message uses conventional commit formatting.

Be sure to share your updates with the [email protected] mailing list!

@castastrophe castastrophe added functionality Functionality, typically pertaining to the JavaScript. tests Related to testing labels Aug 18, 2020
@kylebuch8 kylebuch8 requested a review from TylerMartin5 August 18, 2020 12:43
Copy link
Contributor

@TylerMartin5 TylerMartin5 left a comment

Choose a reason for hiding this comment

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

Linux Green Turkey Michael

@kylebuch8 kylebuch8 merged commit 3ee117e into master Aug 18, 2020
@kylebuch8 kylebuch8 deleted the issue-1045-pfe-autocomplete-event branch August 18, 2020 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

functionality Functionality, typically pertaining to the JavaScript. tests Related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pfe-autocomplete: fire custom event when dropdown is shown

4 participants