Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does this 'inject a checkmark'? #63

Closed
blackfalcon opened this issue Jan 13, 2022 · 2 comments · Fixed by #58
Closed

How does this 'inject a checkmark'? #63

blackfalcon opened this issue Jan 13, 2022 · 2 comments · Fixed by #58
Assignees

Comments

@blackfalcon
Copy link
Member

Understand this code and document as needed.

auro-menu/src/auro-menu.js

Lines 157 to 169 in cd3e934

// Prep each <li>. Give it an index, set its tabindex to -1, add 'keydown' and 'click' event listeners, inject a checkmark auro-icon
for (let iter = 0; iter < this.options.length; iter += 1) {
// each option is tabbable
this.options[iter].setAttribute('tabindex', '0');
this.options[iter].addEventListener('keydown', (evt) => handleKeyDown(evt));
this.options[iter].addEventListener('click', (evt) => dispatchEventOptionSelected(Number(evt.target.getAttribute('index')), evt.target.getAttribute('data-value'), evt.target.innerText));
this.options[iter].addEventListener('focus', (evt) => funcFocus(evt.target));
this.options[iter].addEventListener('blur', (evt) => funcBlur(evt.target));
this.options[iter].addEventListener('mouseover', (evt) => funcMouseOver(evt.target));
this.options[iter].addEventListener('mouseout', (evt) => funcMouseOut(evt.target));
}
}

@jason-capsule42
Copy link
Member

Line 163 - dispatchEventOptionSelected will set the checkmark.

@blackfalcon blackfalcon linked a pull request Jan 18, 2022 that will close this issue
6 tasks
@blackfalcon
Copy link
Member Author

Refactor addressed with fb864c8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants