Skip to content

How to work with customizable <select>? #1230

@RhodeHummel

Description

@RhodeHummel

Prerequisites

  • Can you reproduce the problem in a MWE?
  • Are you running the latest version of AngleSharp?
  • Did you check the FAQs to see if that helps you?
  • Are you reporting to the correct repository? (there are multiple AngleSharp libraries, e.g., AngleSharp.Css for CSS support)
  • Did you perform a search in the issues?

Description

I'm writing a unit test using bUnit. It uses AngleSharp internally. One of my components uses a customizable <select> element as documented here

However, when I try to find the <button> element inside the <select> element it fails. I tried looking through the documentation for AngleSharp to see if there is a way to enable this.

Any suggestions would be appreciated.

Steps to Reproduce

  1. Parse a customized select element:
    <select id="pet-select">
      <button>
        <selectedcontent></selectedcontent>
      </button>

      <option value="">Please select a pet</option>
      <option value="cat">
        <span class="icon" aria-hidden="true">🐱</span
        ><span class="option-label">Cat</span>
      </option>
    </select>

Expected Behavior

The and elements should be discoverable.

Actual Behavior

An exception is thrown

Possible Solution / Known Workarounds

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions