Skip to content

Commit

Permalink
Accordion Example: Fix CSS bugs in MS Edge (pull #502)
Browse files Browse the repository at this point in the history
* Add type=button to accordion triggers

* Fix 2 issues related to CSS bugs in MS Edge

Note: See comments by @gerardkcohen in pull #502 for details about bugs in MS Edge that these changes work around.
  • Loading branch information
gerardkcohen authored and mcking65 committed Oct 27, 2017
1 parent ca272bf commit 794796f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/accordion/accordion.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ <h2 id="ex_label">Example</h2>
<dl id="accordionGroup" role="presentation" class="Accordion">
<dt role="heading" aria-level="3">
<button aria-expanded="true" class="Accordion-trigger"
aria-controls="sect1" id="accordion1id"
aria-controls="sect1" id="accordion1id" type="button"
>
<span class="Accordion-title">Personal Information</span><span class="Accordion-icon"></span>
</button>
Expand Down Expand Up @@ -95,14 +95,14 @@ <h2 id="ex_label">Example</h2>
</dd>
<dt role="heading" aria-level="3">
<button aria-expanded="false" class="Accordion-trigger"
aria-controls="sect2" id="accordion2id"
aria-controls="sect2" id="accordion2id" type="button"
>
<span class="Accordion-title">Billing Address</span><span class="Accordion-icon"></span>
</button>
</dt>
<dd id="sect2" role="region" aria-labelledby="accordion2id" class="Accordion-panel" hidden>
<div>
<fieldset class="billing flex">
<fieldset>
<p>
<label for="b-add1">Address 1:</label>
<input type="text" name="b-add1" id="b-add1" />
Expand All @@ -128,7 +128,7 @@ <h2 id="ex_label">Example</h2>
</dd>
<dt role="heading" aria-level="3">
<button aria-expanded="false" class="Accordion-trigger"
aria-controls="sect3" id="accordion3id"
aria-controls="sect3" id="accordion3id" type="button"
>
<span class="Accordion-title">Shipping Address</span><span class="Accordion-icon"></span>
</button>
Expand Down
6 changes: 6 additions & 0 deletions examples/accordion/css/accordion.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
}

.Accordion-title {
display: block; /* For Edge bug https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8295099/ */
pointer-events: none;
}

Expand Down Expand Up @@ -61,6 +62,11 @@
padding: 1em 1.5em;
}

/* For Edge bug https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/4806035/ */
.Accordion-panel[hidden] {
display: none;
}

fieldset {
border: 0;
margin: 0;
Expand Down

0 comments on commit 794796f

Please sign in to comment.