Browse Source

Fix issue with dropdown menu not opening after select due to preserving focus, fix issue with one segment inside segments group

pull/4074/head
Jack Lukic 9 years ago
parent
commit
fc8d3efdc6
4 changed files with 33 additions and 9 deletions
  1. 3
      RELEASE-NOTES.md
  2. 5
      src/definitions/elements/segment.less
  3. 19
      src/definitions/modules/dropdown.js
  4. 15
      src/definitions/modules/dropdown.less

3
RELEASE-NOTES.md

@ -28,7 +28,9 @@
- **Build Tools** - Fixed gulp help text incorrect for RTL tasks in build tools #3858
- **Button** - Fixed typo in `green inverted button` #3873
- **Button** - Fixed issue where `disabled loading button` would not remove `pointer-events` #2933
- **Button/Dropdown** - Button dropdowns using `default text` no longer receive incorrect font styling for placeholder text
- **Checkbox** - Radio buttons received `indeterminate` styles when user has not yet interacted with the page in Chrome
- **Dropdown** - Fixed bug where using `action: 'hide'` could cause `text` value not to be passed to `onChange` callback
- **Dropdown** - `apiSettings` was not defaulting to use `cache: 'local'` as specified in the docs
- **Dropdown** - `get value` would not return correct value when value was blank #3766
- **Dropdown** - Dropdown would open when an label delete x was clicked when not using `search selection` #3789
@ -50,6 +52,7 @@
- **Progress** - Progress `onSuccess`, `onError`, and `onWarning` callbacks now occur **after** the animation completes for the state change.
- **Rating** - rating does not fire `onRate` when rating is initialized #3712
- **Segment/Message** - `top attached message` has no border when attached to `segment` #3619
- **Segment** - Fixed `segments` to not clip border radius when only a **single** segment is included
- **Statistic** - statistic receives incorrect size when using `tiny` `large` etc inside a statistic group #3116
- **Table** - `striped selectable` table would not correctly show hover color on striped rows

5
src/definitions/elements/segment.less

@ -321,6 +321,11 @@
border-radius: 0em 0em @borderRadius @borderRadius;
}
/* Only */
.ui.segments:not(.horizontal) > .segment:only-child {
border-radius: @borderRadius;
}
/* Nested Group */
.ui.segments > .ui.segments {

19
src/definitions/modules/dropdown.js

@ -402,6 +402,14 @@ $.fn.dropdown = function(parameters) {
.removeData(metadata.text)
.removeData(metadata.value)
;
},
clearData: function() {
module.verbose('Clearing metadata');
$item
.removeData(metadata.text)
.removeData(metadata.value)
;
$module
.removeData(metadata.defaultText)
.removeData(metadata.defaultValue)
@ -540,6 +548,7 @@ $.fn.dropdown = function(parameters) {
if( module.is.searchSelection() ) {
$module
.on('mousedown' + eventNamespace, module.event.mousedown)
.on('mouseup' + eventNamespace, module.event.mouseup)
.on('mousedown' + eventNamespace, selector.menu, module.event.menu.mousedown)
.on('mouseup' + eventNamespace, selector.menu, module.event.menu.mouseup)
.on('click' + eventNamespace, selector.icon, module.event.icon.click)
@ -874,7 +883,13 @@ $.fn.dropdown = function(parameters) {
}
},
mouseup: function() {
activated = false;
if(module.is.searchSelection()) {
// prevent menu hiding on immediate re-focus
willRefocus = false;
}
else {
activated = false;
}
},
search: {
focus: function() {
@ -1463,7 +1478,7 @@ $.fn.dropdown = function(parameters) {
},
hide: function(text, value) {
module.set.value(value);
module.set.value(value, text);
module.hideAndClear();
}

15
src/definitions/modules/dropdown.less

@ -388,12 +388,14 @@ select.ui.dropdown {
.ui.selection.dropdown > .dropdown.icon {
cursor: pointer;
position: absolute;
top: auto;
width: auto;
height: auto;
line-height: @searchSelectionLineHeight;
top: @selectionVerticalPadding;
right: @selectionHorizontalPadding;
z-index: @selectionIconZIndex;
margin: @selectionIconMargin;
padding: @selectionIconPadding;
right: @selectionHorizontalPadding;
opacity: @selectionIconOpacity;
transition: @selectionIconTransition;
}
@ -825,15 +827,14 @@ select.ui.dropdown {
Default Text
----------------------*/
.ui.dropdown > .default.text,
.ui.default.dropdown > .text {
.ui.dropdown:not(.button) > .default.text,
.ui.default.dropdown:not(.button) > .text {
color: @defaultTextColor;
}
.ui.dropdown:hover > .default.text,
.ui.default.dropdown:hover > .text {
.ui.dropdown:not(.button):hover > .default.text,
.ui.default.dropdown:not(.button):hover > .text {
color: @defaultTextHoverColor;
}
/*--------------------
Loading
----------------------*/

Loading…
Cancel
Save