Skip to content

Commit f3603b2

Browse files
authored
Merge pull request #193 from rackerlabs/fix-bugs
Fix bugs
2 parents fbc4963 + 83c45cf commit f3603b2

File tree

8 files changed

+35
-24
lines changed

8 files changed

+35
-24
lines changed

src/helix-ui/elements/HXAccordionPanelElement.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const tagName = 'hx-accordion-panel';
55
const template = document.createElement('template');
66
template.innerHTML = `
77
<style>${shadowStyles}</style>
8-
<button id="toggle" aria-controls="body" aria-expanded="false">
8+
<button type="button" id="toggle" aria-controls="body" aria-expanded="false">
99
<div class="header">
1010
<span class="header__content">
1111
<slot name="header"></slot>
@@ -71,7 +71,9 @@ export class HXAccordionPanelElement extends HXElement {
7171

7272
// PRIVATE METHODS
7373

74-
_onClick () {
74+
_onClick (evt) {
75+
evt.preventDefault();
76+
7577
if (!this.disabled) {
7678
this.open = !this.open;
7779
}

src/helix-ui/elements/HXElement.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,6 @@ export class HXElement extends HTMLElement {
9696
}//$emit
9797

9898
$relayEvent (oldEvent) {
99-
// Original event stops here
100-
oldEvent.preventDefault();
101-
oldEvent.stopPropagation();
102-
oldEvent.stopImmediatePropagation();
103-
10499
// Emit new event of same name
105100
let newEvent = new CustomEvent(oldEvent.type, {
106101
bubbles: oldEvent.bubbles,

src/helix-ui/elements/HXModalElement.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const template = document.createElement('template');
88
template.innerHTML = `
99
<style>${shadowStyles}</style>
1010
<div id="container">
11-
<button id="close">
11+
<button type="button" id="close">
1212
<hx-icon type="times"></hx-icon>
1313
</button>
1414
<slot></slot>
@@ -53,7 +53,9 @@ export class HXModalElement extends HXElement {
5353
}
5454
}//attributeChangedCallback
5555

56-
_close () {
56+
_close (evt) {
57+
evt.preventDefault();
58+
5759
this.open = false;
5860
}
5961

src/helix-ui/elements/HXSearchElement.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ template.innerHTML = `
88
<style>${shadowStyles}</style>
99
<label id="wrapper">
1010
<input type="text" role="search" id="search" autocomplete="off" />
11-
<button id="clear" hidden aria-label="Clear search">
11+
<button type="button" id="clear" hidden aria-label="Clear search">
1212
<hx-icon type="times"></hx-icon>
1313
</button>
1414
<div id="icon">
@@ -145,7 +145,9 @@ export class HXSearchElement extends HXElement {
145145
}
146146
}
147147

148-
_clearValue () {
148+
_clearValue (evt) {
149+
evt.preventDefault();
150+
149151
this.value = '';
150152

151153
// Emit a 'clear' event to communicate state change.

src/helix-ui/elements/_hx-element.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
letter-spacing: inherit;
88
}
99

10-
input[type="text"]::-ms-clear {
10+
input::-ms-clear {
1111
display: none;
1212
}

src/helix-ui/styles/reset.less

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,13 @@ hr {
4545
border-width: 1px 0 0;
4646
margin: 0.75rem 0;
4747
}
48+
49+
// Remove "X" added by Edge and IE
50+
input::-ms-clear {
51+
display: none;
52+
}
53+
54+
// Ensure that browsers inherit the proper font settings.
55+
textarea {
56+
font: inherit;
57+
}

test/regression/generateRegressionTests.js.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ Generated by [AVA](https://ava.li).
696696
697697
<label id="wrapper" class="style-scope hx-search">␊
698698
<input role="search" id="search" autocomplete="off" class="style-scope hx-search" type="text">␊
699-
<button id="clear" aria-label="Clear search" class="style-scope hx-search" hidden="">␊
699+
<button type="button" id="clear" aria-label="Clear search" class="style-scope hx-search" hidden="">␊
700700
<hx-icon type="times" class="style-scope hx-search" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" focusable="false" class="style-scope hx-search"><path d="M9.414 8l4.293-4.293a.999.999 0 1 0-1.414-1.414L8 6.586 3.707 2.293a.999.999 0 1 0-1.414 1.414L6.586 8l-4.293 4.293a.999.999 0 1 0 1.414 1.414L8 9.414l4.293 4.293a.997.997 0 0 0 1.414 0 .999.999 0 0 0 0-1.414L9.414 8z" class="style-scope hx-search"></path></svg></hx-icon>␊
701701
</button>␊
702702
<div id="icon" class="style-scope hx-search">␊
@@ -711,7 +711,7 @@ Generated by [AVA](https://ava.li).
711711
712712
<label id="wrapper" class="style-scope hx-search">␊
713713
<input role="search" id="search" autocomplete="off" class="style-scope hx-search" placeholder="Search..." type="text">␊
714-
<button id="clear" aria-label="Clear search" class="style-scope hx-search" hidden="">␊
714+
<button type="button" id="clear" aria-label="Clear search" class="style-scope hx-search" hidden="">␊
715715
<hx-icon type="times" class="style-scope hx-search" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" focusable="false" class="style-scope hx-search"><path d="M9.414 8l4.293-4.293a.999.999 0 1 0-1.414-1.414L8 6.586 3.707 2.293a.999.999 0 1 0-1.414 1.414L6.586 8l-4.293 4.293a.999.999 0 1 0 1.414 1.414L8 9.414l4.293 4.293a.997.997 0 0 0 1.414 0 .999.999 0 0 0 0-1.414L9.414 8z" class="style-scope hx-search"></path></svg></hx-icon>␊
716716
</button>␊
717717
<div id="icon" class="style-scope hx-search">␊
@@ -726,7 +726,7 @@ Generated by [AVA](https://ava.li).
726726
727727
<label id="wrapper" class="style-scope hx-search">␊
728728
<input role="search" id="search" autocomplete="off" class="style-scope hx-search" type="text">␊
729-
<button id="clear" aria-label="Clear search" class="style-scope hx-search">␊
729+
<button type="button" id="clear" aria-label="Clear search" class="style-scope hx-search">␊
730730
<hx-icon type="times" class="style-scope hx-search" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" focusable="false" class="style-scope hx-search"><path d="M9.414 8l4.293-4.293a.999.999 0 1 0-1.414-1.414L8 6.586 3.707 2.293a.999.999 0 1 0-1.414 1.414L6.586 8l-4.293 4.293a.999.999 0 1 0 1.414 1.414L8 9.414l4.293 4.293a.997.997 0 0 0 1.414 0 .999.999 0 0 0 0-1.414L9.414 8z" class="style-scope hx-search"></path></svg></hx-icon>␊
731731
</button>␊
732732
<div id="icon" class="style-scope hx-search">␊
@@ -744,7 +744,7 @@ Generated by [AVA](https://ava.li).
744744
745745
<label id="wrapper" class="style-scope hx-search">␊
746746
<input role="search" id="search" autocomplete="off" class="style-scope hx-search" type="text">␊
747-
<button id="clear" aria-label="Clear search" class="style-scope hx-search" hidden="">␊
747+
<button type="button" id="clear" aria-label="Clear search" class="style-scope hx-search" hidden="">␊
748748
<hx-icon type="times" class="style-scope hx-search" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" focusable="false" class="style-scope hx-search"><path d="M9.414 8l4.293-4.293a.999.999 0 1 0-1.414-1.414L8 6.586 3.707 2.293a.999.999 0 1 0-1.414 1.414L6.586 8l-4.293 4.293a.999.999 0 1 0 1.414 1.414L8 9.414l4.293 4.293a.997.997 0 0 0 1.414 0 .999.999 0 0 0 0-1.414L9.414 8z" class="style-scope hx-search"></path></svg></hx-icon>␊
749749
</button>␊
750750
<div id="icon" class="style-scope hx-search">␊
@@ -759,7 +759,7 @@ Generated by [AVA](https://ava.li).
759759
760760
<label id="wrapper" class="style-scope hx-search">␊
761761
<input role="search" id="search" autocomplete="off" class="style-scope hx-search" placeholder="Search..." type="text">␊
762-
<button id="clear" aria-label="Clear search" class="style-scope hx-search" hidden="">␊
762+
<button type="button" id="clear" aria-label="Clear search" class="style-scope hx-search" hidden="">␊
763763
<hx-icon type="times" class="style-scope hx-search" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" focusable="false" class="style-scope hx-search"><path d="M9.414 8l4.293-4.293a.999.999 0 1 0-1.414-1.414L8 6.586 3.707 2.293a.999.999 0 1 0-1.414 1.414L6.586 8l-4.293 4.293a.999.999 0 1 0 1.414 1.414L8 9.414l4.293 4.293a.997.997 0 0 0 1.414 0 .999.999 0 0 0 0-1.414L9.414 8z" class="style-scope hx-search"></path></svg></hx-icon>␊
764764
</button>␊
765765
<div id="icon" class="style-scope hx-search">␊
@@ -774,7 +774,7 @@ Generated by [AVA](https://ava.li).
774774
775775
<label id="wrapper" class="style-scope hx-search">␊
776776
<input role="search" id="search" autocomplete="off" class="style-scope hx-search" type="text">␊
777-
<button id="clear" aria-label="Clear search" class="style-scope hx-search">␊
777+
<button type="button" id="clear" aria-label="Clear search" class="style-scope hx-search">␊
778778
<hx-icon type="times" class="style-scope hx-search" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" focusable="false" class="style-scope hx-search"><path d="M9.414 8l4.293-4.293a.999.999 0 1 0-1.414-1.414L8 6.586 3.707 2.293a.999.999 0 1 0-1.414 1.414L6.586 8l-4.293 4.293a.999.999 0 1 0 1.414 1.414L8 9.414l4.293 4.293a.997.997 0 0 0 1.414 0 .999.999 0 0 0 0-1.414L9.414 8z" class="style-scope hx-search"></path></svg></hx-icon>␊
779779
</button>␊
780780
<div id="icon" class="style-scope hx-search">␊
@@ -792,7 +792,7 @@ Generated by [AVA](https://ava.li).
792792
793793
<label id="wrapper" class="style-scope hx-search">␊
794794
<input role="search" id="search" autocomplete="off" class="style-scope hx-search" disabled="" type="text">␊
795-
<button id="clear" aria-label="Clear search" class="style-scope hx-search" hidden="">␊
795+
<button type="button" id="clear" aria-label="Clear search" class="style-scope hx-search" hidden="">␊
796796
<hx-icon type="times" class="style-scope hx-search" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" focusable="false" class="style-scope hx-search"><path d="M9.414 8l4.293-4.293a.999.999 0 1 0-1.414-1.414L8 6.586 3.707 2.293a.999.999 0 1 0-1.414 1.414L6.586 8l-4.293 4.293a.999.999 0 1 0 1.414 1.414L8 9.414l4.293 4.293a.997.997 0 0 0 1.414 0 .999.999 0 0 0 0-1.414L9.414 8z" class="style-scope hx-search"></path></svg></hx-icon>␊
797797
</button>␊
798798
<div id="icon" class="style-scope hx-search">␊
@@ -807,7 +807,7 @@ Generated by [AVA](https://ava.li).
807807
808808
<label id="wrapper" class="style-scope hx-search">␊
809809
<input role="search" id="search" autocomplete="off" class="style-scope hx-search" disabled="" placeholder="Search..." type="text">␊
810-
<button id="clear" aria-label="Clear search" class="style-scope hx-search" hidden="">␊
810+
<button type="button" id="clear" aria-label="Clear search" class="style-scope hx-search" hidden="">␊
811811
<hx-icon type="times" class="style-scope hx-search" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" focusable="false" class="style-scope hx-search"><path d="M9.414 8l4.293-4.293a.999.999 0 1 0-1.414-1.414L8 6.586 3.707 2.293a.999.999 0 1 0-1.414 1.414L6.586 8l-4.293 4.293a.999.999 0 1 0 1.414 1.414L8 9.414l4.293 4.293a.997.997 0 0 0 1.414 0 .999.999 0 0 0 0-1.414L9.414 8z" class="style-scope hx-search"></path></svg></hx-icon>␊
812812
</button>␊
813813
<div id="icon" class="style-scope hx-search">␊
@@ -822,7 +822,7 @@ Generated by [AVA](https://ava.li).
822822
823823
<label id="wrapper" class="style-scope hx-search">␊
824824
<input role="search" id="search" autocomplete="off" class="style-scope hx-search" disabled="" type="text">␊
825-
<button id="clear" aria-label="Clear search" class="style-scope hx-search">␊
825+
<button type="button" id="clear" aria-label="Clear search" class="style-scope hx-search">␊
826826
<hx-icon type="times" class="style-scope hx-search" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" focusable="false" class="style-scope hx-search"><path d="M9.414 8l4.293-4.293a.999.999 0 1 0-1.414-1.414L8 6.586 3.707 2.293a.999.999 0 1 0-1.414 1.414L6.586 8l-4.293 4.293a.999.999 0 1 0 1.414 1.414L8 9.414l4.293 4.293a.997.997 0 0 0 1.414 0 .999.999 0 0 0 0-1.414L9.414 8z" class="style-scope hx-search"></path></svg></hx-icon>␊
827827
</button>␊
828828
<div id="icon" class="style-scope hx-search">␊
@@ -840,7 +840,7 @@ Generated by [AVA](https://ava.li).
840840
841841
<label id="wrapper" class="style-scope hx-search">␊
842842
<input role="search" id="search" autocomplete="off" class="style-scope hx-search" disabled="" type="text">␊
843-
<button id="clear" aria-label="Clear search" class="style-scope hx-search" hidden="">␊
843+
<button type="button" id="clear" aria-label="Clear search" class="style-scope hx-search" hidden="">␊
844844
<hx-icon type="times" class="style-scope hx-search" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" focusable="false" class="style-scope hx-search"><path d="M9.414 8l4.293-4.293a.999.999 0 1 0-1.414-1.414L8 6.586 3.707 2.293a.999.999 0 1 0-1.414 1.414L6.586 8l-4.293 4.293a.999.999 0 1 0 1.414 1.414L8 9.414l4.293 4.293a.997.997 0 0 0 1.414 0 .999.999 0 0 0 0-1.414L9.414 8z" class="style-scope hx-search"></path></svg></hx-icon>␊
845845
</button>␊
846846
<div id="icon" class="style-scope hx-search">␊
@@ -855,7 +855,7 @@ Generated by [AVA](https://ava.li).
855855
856856
<label id="wrapper" class="style-scope hx-search">␊
857857
<input role="search" id="search" autocomplete="off" class="style-scope hx-search" disabled="" placeholder="Search..." type="text">␊
858-
<button id="clear" aria-label="Clear search" class="style-scope hx-search" hidden="">␊
858+
<button type="button" id="clear" aria-label="Clear search" class="style-scope hx-search" hidden="">␊
859859
<hx-icon type="times" class="style-scope hx-search" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" focusable="false" class="style-scope hx-search"><path d="M9.414 8l4.293-4.293a.999.999 0 1 0-1.414-1.414L8 6.586 3.707 2.293a.999.999 0 1 0-1.414 1.414L6.586 8l-4.293 4.293a.999.999 0 1 0 1.414 1.414L8 9.414l4.293 4.293a.997.997 0 0 0 1.414 0 .999.999 0 0 0 0-1.414L9.414 8z" class="style-scope hx-search"></path></svg></hx-icon>␊
860860
</button>␊
861861
<div id="icon" class="style-scope hx-search">␊
@@ -870,7 +870,7 @@ Generated by [AVA](https://ava.li).
870870
871871
<label id="wrapper" class="style-scope hx-search">␊
872872
<input role="search" id="search" autocomplete="off" class="style-scope hx-search" disabled="" type="text">␊
873-
<button id="clear" aria-label="Clear search" class="style-scope hx-search">␊
873+
<button type="button" id="clear" aria-label="Clear search" class="style-scope hx-search">␊
874874
<hx-icon type="times" class="style-scope hx-search" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" focusable="false" class="style-scope hx-search"><path d="M9.414 8l4.293-4.293a.999.999 0 1 0-1.414-1.414L8 6.586 3.707 2.293a.999.999 0 1 0-1.414 1.414L6.586 8l-4.293 4.293a.999.999 0 1 0 1.414 1.414L8 9.414l4.293 4.293a.997.997 0 0 0 1.414 0 .999.999 0 0 0 0-1.414L9.414 8z" class="style-scope hx-search"></path></svg></hx-icon>␊
875875
</button>␊
876876
<div id="icon" class="style-scope hx-search">␊
9 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)