Browse Source

Odds and end fixes for dropdown

pull/2092/head
jlukic 10 years ago
parent
commit
dcf0190a3f
6 changed files with 13 additions and 10 deletions
  1. 2
      RELEASE-NOTES.md
  2. 1
      src/definitions/collections/form.less
  3. 5
      src/definitions/modules/dropdown.js
  4. 8
      src/definitions/modules/dropdown.less
  5. 1
      src/themes/default/elements/icon.overrides
  6. 6
      src/themes/default/modules/dropdown.variables

2
RELEASE-NOTES.md

@ -96,6 +96,8 @@
- **Dropdown** - Fixed issue with `search selection` not changing text when reselecting same value from list - **Dropdown** - Fixed issue with `search selection` not changing text when reselecting same value from list
- **Dropdown** - Dropdown `menu` now use same font size as dropdown - **Dropdown** - Dropdown `menu` now use same font size as dropdown
- **Dropdown** - Fixed behaviors called on `<select>` after initialization not being correctly applied to `ui dropdown` - **Dropdown** - Fixed behaviors called on `<select>` after initialization not being correctly applied to `ui dropdown`
- **Dropdown** - Fixed `search dropdown` submitting parent form when enter shortcut pressed
- **Form** - `field` inside `fields` no longer produce double sized margins.
- **Form** - Form sizes and input sizes now inherit from `site.variables` - **Form** - Form sizes and input sizes now inherit from `site.variables`
- **Form Validation** - Form validation now validates correctly on `<select>` change - **Form Validation** - Form validation now validates correctly on `<select>` change
- **Grid** - Fix `doubling row` not working correctly inside a different `doubling grid` (css spec issue) - **Grid** - Fix `doubling row` not working correctly inside a different `doubling grid` (css spec issue)

1
src/definitions/collections/form.less

@ -49,6 +49,7 @@
clear: both; clear: both;
margin: @fieldMargin; margin: @fieldMargin;
} }
.ui.form .field .field,
.ui.form .fields:last-child, .ui.form .fields:last-child,
.ui.form .field:last-child { .ui.form .field:last-child {
margin-bottom: 0em; margin-bottom: 0em;

5
src/definitions/modules/dropdown.js

@ -872,6 +872,7 @@ $.fn.dropdown = function(parameters) {
module.event.item.click.call($selectedItem, event); module.event.item.click.call($selectedItem, event);
event.stopImmediatePropagation(); event.stopImmediatePropagation();
} }
event.preventDefault();
} }
// left arrow (hide sub-menu) // left arrow (hide sub-menu)
@ -969,11 +970,13 @@ $.fn.dropdown = function(parameters) {
if(pressedKey == keys.enter) { if(pressedKey == keys.enter) {
module.verbose('Enter key pressed, showing dropdown'); module.verbose('Enter key pressed, showing dropdown');
module.show(); module.show();
event.preventDefault();
} }
// down arrow (open menu) // down arrow (open menu)
if(pressedKey == keys.downArrow) { if(pressedKey == keys.downArrow) {
module.verbose('Down key pressed, showing dropdown'); module.verbose('Down key pressed, showing dropdown');
module.show(); module.show();
event.preventDefault();
} }
} }
} }
@ -1197,7 +1200,7 @@ $.fn.dropdown = function(parameters) {
? $(this).attr('value') ? $(this).attr('value')
: name : name
; ;
if(settings.placeholder !== 'auto' && value === '') {
if(settings.placeholder === 'auto' && value === '') {
select.placeholder = name; select.placeholder = name;
} }
else { else {

8
src/definitions/modules/dropdown.less

@ -522,12 +522,10 @@ select.ui.dropdown {
} }
/* Text Layering */ /* Text Layering */
.ui.search.dropdown > .pointer > input.search,
.ui.search.dropdown > input.search { .ui.search.dropdown > input.search {
position: absolute; position: absolute;
z-index: 2; z-index: 2;
} }
.ui.search.dropdown > .pointer > .text,
.ui.search.dropdown > .text { .ui.search.dropdown > .text {
cursor: text; cursor: text;
position: relative; position: relative;
@ -535,21 +533,16 @@ select.ui.dropdown {
} }
/* Search Selection */ /* Search Selection */
.ui.search.selection.dropdown > .pointer > input.search,
.ui.search.selection.dropdown > input.search { .ui.search.selection.dropdown > input.search {
line-height: @searchSelectionLineHeight; line-height: @searchSelectionLineHeight;
padding: @searchSelectionInputPadding; padding: @searchSelectionInputPadding;
} }
/* Active/Visible Search */ /* Active/Visible Search */
.ui.search.dropdown.active > .pointer > input.search,
.ui.search.dropdown.visible > .pointer > input.search,
.ui.search.dropdown.active > input.search, .ui.search.dropdown.active > input.search,
.ui.search.dropdown.visible > input.search { .ui.search.dropdown.visible > input.search {
cursor: auto; cursor: auto;
} }
.ui.search.dropdown.active > .pointer > .text,
.ui.search.dropdown.visible > .pointer > .text,
.ui.search.dropdown.active > .text, .ui.search.dropdown.active > .text,
.ui.search.dropdown.visible > .text { .ui.search.dropdown.visible > .text {
pointer-events: none; pointer-events: none;
@ -630,6 +623,7 @@ select.ui.dropdown {
position: static; position: static;
padding: 0; padding: 0;
max-width: 100%; max-width: 100%;
min-height: @searchSelectionLineHeight;
line-height: @searchSelectionLineHeight; line-height: @searchSelectionLineHeight;
margin: @multipleSelectionInlineMargin; margin: @multipleSelectionInlineMargin;
} }

1
src/themes/default/elements/icon.overrides

@ -710,6 +710,7 @@ i.icon.target:before { content: "\f140"; }
i.icon.play.circle:before { content: "\f144"; } i.icon.play.circle:before { content: "\f144"; }
i.icon.pencil.square:before { content: "\f14b"; } i.icon.pencil.square:before { content: "\f14b"; }
i.icon.compass:before { content: "\f14e"; } i.icon.compass:before { content: "\f14e"; }
i.icon.amex:before { content: "\f1f3"; }
i.icon.eur:before { content: "\f153"; } i.icon.eur:before { content: "\f153"; }
i.icon.gbp:before { content: "\f154"; } i.icon.gbp:before { content: "\f154"; }
i.icon.usd:before { content: "\f155"; } i.icon.usd:before { content: "\f155"; }

6
src/themes/default/modules/dropdown.variables

@ -209,14 +209,16 @@
/* Search Selection */ /* Search Selection */
@searchSelectionLineHeight: 1.2142em; /* browser default for webkit <input> */ @searchSelectionLineHeight: 1.2142em; /* browser default for webkit <input> */
@searchSelectionLineHeightOffset: ((@searchSelectionLineHeight - 1em) / 2); @searchSelectionLineHeightOffset: ((@searchSelectionLineHeight - 1em) / 2);
@searchSelectionInputPadding: (@selectionVerticalPadding - @searchSelectionLineHeightOffset) @selectionHorizontalPadding;
@searchSelectionVerticalPadding: (@selectionVerticalPadding - @searchSelectionLineHeightOffset);
@searchSelectionHorizontalPadding: @selectionHorizontalPadding;
@searchSelectionInputPadding: @searchSelectionVerticalPadding @selectionIconDistance @searchSelectionVerticalPadding @searchSelectionHorizontalPadding;
@searchMobileMaxMenuHeight: @selectionMobileMaxMenuHeight; @searchMobileMaxMenuHeight: @selectionMobileMaxMenuHeight;
@searchTabletMaxMenuHeight: @selectionTabletMaxMenuHeight; @searchTabletMaxMenuHeight: @selectionTabletMaxMenuHeight;
@searchComputerMaxMenuHeight: @selectionComputerMaxMenuHeight; @searchComputerMaxMenuHeight: @selectionComputerMaxMenuHeight;
@searchWidescreenMaxMenuHeight: @selectionWidescreenMaxMenuHeight; @searchWidescreenMaxMenuHeight: @selectionWidescreenMaxMenuHeight;
/* Multiple */
/* Multiple Selection */
@labelVerticalPadding: 0.4285em; @labelVerticalPadding: 0.4285em;
@labelSize: @relativeSmall; @labelSize: @relativeSmall;
@labelHorizontalPadding: @relativeMini; @labelHorizontalPadding: @relativeMini;

Loading…
Cancel
Save