Skip to content

Commit

Permalink
fix: add public show/hide api
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisfalaska committed Oct 31, 2024
1 parent cc315f3 commit b77a474
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions components/dropdown/src/auro-dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,22 @@ export class AuroDropdown extends LitElement {
this.iconTag = versioning.generateTag('auro-icon', iconVersion, AuroIcon);
}

/**
* Public method to hide the dropdown
* @returns {void}
*/
hide() {
this.floater.hideBib();
}

/**
* Public method to show the dropdown
* @returns {void}
*/
show() {
this.floater.showBib();
}

// function to define props used within the scope of this component
static get properties() {

Expand Down
2 changes: 1 addition & 1 deletion components/dropdown/src/floatingUI.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default class AuroFloatingUI {
return;
}

const activeElement = document.activeElement;
const {activeElement} = document;
if (activeElement === document.querySelector('body') ||
this.element.contains(activeElement) ||
this.element.bibContent?.contains(activeElement)) {
Expand Down

0 comments on commit b77a474

Please sign in to comment.