From 87354ab09f84898b0f62f12318399fb30ba7038a Mon Sep 17 00:00:00 2001 From: Brendan Behrens Date: Mon, 2 Nov 2020 15:09:16 -0500 Subject: [PATCH 1/2] Add stopPropagation to Dropdown.js This commit re-adds teh stopPropagation property to a dropdown for the dropdown trigger --- js/dropdown.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/js/dropdown.js b/js/dropdown.js index 5fd0d98668..eedea0c111 100644 --- a/js/dropdown.js +++ b/js/dropdown.js @@ -15,7 +15,8 @@ onOpenEnd: null, onCloseStart: null, onCloseEnd: null, - onItemClick: null + onItemClick: null, + stopPropagation: false }; /** @@ -48,6 +49,7 @@ * @prop {Function} onOpenEnd - Function called when dropdown finishes opening * @prop {Function} onCloseStart - Function called when dropdown starts closing * @prop {Function} onCloseEnd - Function called when dropdown finishes closing + * @prop {Boolean} [stopPropagation=false] - Constrain width to width of the button */ this.options = $.extend({}, Dropdown.defaults, options); @@ -170,6 +172,11 @@ _handleClick(e) { e.preventDefault(); + + if (stopPropagation) { + e.stopPropagation(); + } + this.open(); } From 4138da4723e810ffaf46c9300a49e74d74906a67 Mon Sep 17 00:00:00 2001 From: Brendan Behrens Date: Mon, 2 Nov 2020 15:26:49 -0500 Subject: [PATCH 2/2] Update dropdown_content.html Updates the docs for the dropdown --- jade/page-contents/dropdown_content.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jade/page-contents/dropdown_content.html b/jade/page-contents/dropdown_content.html index 3843414af4..68898765b4 100644 --- a/jade/page-contents/dropdown_content.html +++ b/jade/page-contents/dropdown_content.html @@ -153,6 +153,12 @@

Options

null Function called when dropdown finishes exiting. + + stopPropagation + Boolean + false + Stop the propagation of a click event for the dropdown trigger +