{{#if (or @isOpen @static)}}
  {{#let (element (or @as 'ul')) as |Tag|}}
    <Tag
      id={{@guid}}
      tabindex='0'
      role='listbox'
      aria-labelledby={{if
        @hasLabelElement
        (concat @guid '-label')
        (concat @guid '-button')
      }}
      aria-activedescendant={{@activeOptionGuid}}
      aria-orientation='vertical'
      aria-multiselectable={{if @multiple 'true'}}
      {{this.registerOptions}}
      {{on 'keypress' @handleKeyPress}}
      {{on 'keydown' @handleKeyDown}}
      {{on 'keyup' @handleKeyUp}}
      {{headlessui-focus-trap
        focusTrapOptions=(hash
          allowOutsideClick=@handleClickOutside fallbackFocus=(concat '#' @guid)
        )
      }}
      ...attributes
    >
      {{yield
        (hash
          Option=(component
            'listbox/-option'
            registerOptionElement=@registerOptionElement
            unregisterOptionElement=@unregisterOptionElement
            activeOptionGuid=@activeOptionGuid
            selectedOptionGuids=@selectedOptionGuids
            setActiveOption=@setActiveOption
            unsetActiveOption=@unsetActiveOption
            setSelectedOption=@setSelectedOption
            selectedValue=@selectedValue
            scrollIntoView=@scrollIntoView
            multiple=@multiple
          )
        )
      }}
    </Tag>
  {{/let}}
{{/if}}