Skip to content

Commit b3f1e46

Browse files
authored
fix: pfe-dropdown: remove preventDefault call on clicks outside of dropdown (#915)
* fix: pfe-dropdown: remove preventDefault call on clicks outside of dropdown Fixes #913 * changelog updates for pfe-dropdown
1 parent 342fe80 commit b3f1e46

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

CHANGELOG-prerelease.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## Prerelease 50 ( TBD )
22

3+
- [](https://github.com/patternfly/patternfly-elements/commit/) fix: pfe-dropdown: remove preventDefault call on clicks outside of dropdown #915
4+
- [](https://github.com/patternfly/patternfly-elements/commit/) feat: Automerging PRs based on labels
35
- [775b821](https://github.com/patternfly/patternfly-elements/commit/775b821702c903f926b8bf9fdf9c948ac949335f) feat: Add automatic labeling to PRs
46
- [82bf8e6](https://github.com/patternfly/patternfly-elements/commit/82bf8e6a0d407a651571dac1e37d06a2b14fa3d4) feat: Move PR cards automatically in the Project when labels are changed
57
- [235e9a8](https://github.com/patternfly/patternfly-elements/commit/235e9a816b763dc9251e3022c914cba72f148368) fix: Move tab headings to the ShadowDOM
@@ -9,7 +11,6 @@
911
- Update paths to built-in sets: (#723)
1012
- Storybook icon listing: (#728)
1113
- Icon panel storybook: (#719)
12-
- [](https://github.com/patternfly/patternfly-elements/commit/) feat: Automerging PRs based on labels
1314

1415
## Prerelease 49 ( 2020-05-29 )
1516

elements/pfe-dropdown/src/pfe-dropdown.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ class PfeDropdown extends PFElement {
212212
: null;
213213
// Check states to determine if the dropdown menu should close
214214
if (!isSelf && !(isChild || insideWrapper)) {
215-
this.close(event);
215+
this.close();
216216
}
217217
}
218218

elements/pfe-dropdown/test/pfe-dropdown_test.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
<pfe-dropdown pfe-label="Test dropdown with custom options" id="customDropdown">
3535
</pfe-dropdown>
3636

37+
<input type="checkbox" id="checkbox"/>
38+
3739
<script>
3840
suite('<pfe-dropdown>', () => {
3941
test('it should upgrade', () => {
@@ -146,6 +148,12 @@
146148

147149
});
148150

151+
test("it should not have event.preventDefault called on elements outside of the dropdown", () => {
152+
const checkbox = document.querySelector("#checkbox");
153+
checkbox.click();
154+
155+
assert.isTrue(checkbox.checked);
156+
});
149157
});
150158
</script>
151159
</body>

0 commit comments

Comments
 (0)