Continuing to work on dropdown
All checks were successful
Build, Test, and Publish (to Private NPM Registry) UI Components Library / publish (push) Successful in 1m0s
All checks were successful
Build, Test, and Publish (to Private NPM Registry) UI Components Library / publish (push) Successful in 1m0s
This commit is contained in:
parent
cdeb8071ef
commit
0290bc6dd5
2 changed files with 5 additions and 3 deletions
|
|
@ -55,7 +55,7 @@
|
|||
<% } %>
|
||||
<!-- END: Scripts -->
|
||||
|
||||
<div role="button" class="dropdown-trigger<%= typeof triggerStyleClasses !== 'undefined' ? ' ' + triggerStyleClasses.join(' ') : '' %>" tabindex="0" aria-expanded="false" aria-controls="<%= typeof menuId !== 'undefined' ? menuId : 'dropdown-menu' %>" aria-haspopup="true" popovertarget="<%= typeof menuId !== 'undefined' ? menuId : 'dropdown-menu' %>">
|
||||
<button role="button" class="dropdown-trigger<%= typeof triggerStyleClasses !== 'undefined' ? ' ' + triggerStyleClasses.join(' ') : '' %>" tabindex="0" aria-expanded="false" aria-controls="<%= typeof menuId !== 'undefined' ? menuId : 'dropdown-menu' %>" aria-haspopup="true" popovertarget="<%= typeof menuId !== 'undefined' ? menuId : 'dropdown-menu' %>">
|
||||
<slot name="dropdown-trigger"></slot>
|
||||
|
||||
<%
|
||||
|
|
@ -75,7 +75,7 @@
|
|||
<%# <i class="fas fa-chevron-down" aria-hidden="true"></i> %>
|
||||
<%- chevronSvg %>
|
||||
<% } %>
|
||||
</div>
|
||||
</button>
|
||||
<div id="<%= typeof menuId !== 'undefined' ? menuId : 'dropdown-menu' %>" class="dropdown-menu<%= typeof menuStyleClasses !== 'undefined' ? ' ' + menuStyleClasses.join(' ') : '' %>"<%# hidden%> popover>
|
||||
<slot name="dropdown-menu"></slot>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -41,6 +41,8 @@ export class Dropdown extends ComposableElement {
|
|||
|
||||
event.preventDefault();
|
||||
|
||||
console.log(`Dropdown keydown: ${event.key}`);
|
||||
|
||||
const focusableItems = Array.from(this.querySelectorAll('li'));
|
||||
|
||||
if (focusableItems.length === 0) {
|
||||
|
|
@ -146,7 +148,7 @@ export class Dropdown extends ComposableElement {
|
|||
shadow.appendChild(cssAnchorPolyfill);
|
||||
|
||||
// Create the trigger div for the dropdown component
|
||||
const dropdownTriggerDiv = document.createElement('div');
|
||||
const dropdownTriggerDiv = document.createElement('button');
|
||||
dropdownTriggerDiv.role = 'button';
|
||||
dropdownTriggerDiv.tabIndex = 0;
|
||||
dropdownTriggerDiv.setAttribute('aria-expanded', 'false');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue