@@ -269,7 +269,10 @@ select = makeStateless component render
269
269
lumiSelectInputSelectedValueElement
270
270
{ key: " lumi-select-selected-value-" <> (props.toSelectOption value).value
271
271
, children:
272
- [ props.optionRenderer value
272
+ [ lumiSelectInputSelectedValueTextElement
273
+ { children: [ props.optionRenderer value ]
274
+ , title: (props.toSelectOption value).label
275
+ }
273
276
, lumiSelectClearIconElement
274
277
{ key: " --createElementKeyed-shouldnt-require-this--"
275
278
, children: Icon .icon_ Icon.Remove
@@ -339,13 +342,17 @@ select = makeStateless component render
339
342
}
340
343
]
341
344
renderOptions options_ = options_ `flip Array.mapWithIndex` \index option ->
342
- lumiSelectOptionElement
343
- { key: " lumi-select-menu-option-" <> (props.toSelectOption option).value
344
- , " data-focus" : maybe false (_ == index) selectState.focusedIndex
345
- , children: props.optionRenderer option
346
- , onClick: capture_ do
347
- selectState.addSelectedOption option
348
- }
345
+ let
346
+ { label, value } = props.toSelectOption option
347
+ in
348
+ lumiSelectOptionElement
349
+ { key: " lumi-select-menu-option-" <> value
350
+ , " data-focus" : maybe false (_ == index) selectState.focusedIndex
351
+ , children: props.optionRenderer option
352
+ , title: label
353
+ , onClick: capture_ do
354
+ selectState.addSelectedOption option
355
+ }
349
356
350
357
lumiSelectElement =
351
358
element (R .unsafeCreateDOMComponent " lumi-select" )
@@ -361,6 +368,8 @@ select = makeStateless component render
361
368
element (R .unsafeCreateDOMComponent " lumi-select-input-selected-values" )
362
369
lumiSelectInputSelectedValueElement =
363
370
elementKeyed (R .unsafeCreateDOMComponent " lumi-select-input-selected-value" )
371
+ lumiSelectInputSelectedValueTextElement =
372
+ element (R .unsafeCreateDOMComponent " lumi-select-input-selected-value-text" )
364
373
lumiSelectClearIconElement =
365
374
element (R .unsafeCreateDOMComponent " lumi-select-clear-icon" )
366
375
lumiSelectMenuAnchorElement =
@@ -394,18 +403,16 @@ styles = jss
394
403
395
404
, " & lumi-select-input" :
396
405
{ extend: lumiInputStyles
397
- , position: " relative" -- for placeholder
398
406
, display: " flex"
399
407
, flexFlow: " row"
408
+ , flex: " 0 0 100%"
400
409
, minHeight: " 32px" -- input height (-8px from standard input sizing to account for select wrapper)
401
410
, lineHeight: " 32px"
402
411
, " @media (min-width: 860px)" :
403
412
{ minHeight: " 24px"
404
413
, lineHeight: " 24px"
405
414
, backgroundPositionY: " 12px"
406
415
}
407
- , minWidth: " 200px"
408
- , maxWidth: " 100%"
409
416
, backgroundImage: "url(\"data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='UTF-8'?%3E%3Csvg width='11px' height='5px' viewBox='0 0 11 5' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3C!-- Generator: Sketch 49.1 (51147) - http://www.bohemiancoding.com/sketch --%3E%3Ctitle%3ESlice 1%3C/title%3E%3Cdesc%3ECreated with Sketch.%3C/desc%3E%3Cdefs%3E%3Cpath d='M5.417,3.519 C5.797,3.187 6.307,2.733 6.912,2.185 L6.974,2.129 C7.70584693,1.46645784 8.43485361,0.800785071 9.161,0.132 C9.29247374,0.0108869595 9.47857352,-0.0308857001 9.64919735,0.0224173781 C9.81982119,0.0757204563 9.94904726,0.216001266 9.98819736,0.390417384 C10.0273475,0.564833501 9.97047374,0.746886966 9.839,0.868 C9.11068658,1.53896706 8.37934578,2.20664054 7.645,2.871 L7.583,2.927 C5.376,4.922 5.287,5 5,5 C4.713,5 4.624,4.922 2.417,2.927 L2.355,2.871 C1.62081041,2.20646869 0.889470368,1.5387959 0.161,0.868 C-0.0422407879,0.68077547 -0.0552245302,0.364240788 0.132,0.161 C0.31922453,-0.0422407879 0.635759212,-0.0552245302 0.839,0.132 C1.5649901,0.800955473 2.29399753,1.46662893 3.026,2.129 L3.088,2.185 C3.693,2.733 4.203,3.187 4.583,3.519 C4.75,3.665 4.89,3.785 5,3.877 C5.11,3.785 5.25,3.665 5.417,3.519 Z' id='path-1'%3E%3C/path%3E%3C/defs%3E%3Cg id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='arrow-down'%3E%3Cg id='a-link' fill='%2342413F' fill-rule='nonzero'%3E%3Cpath d='M5.417,3.519 C5.797,3.187 6.307,2.733 6.912,2.185 L6.974,2.129 C7.70584693,1.46645784 8.43485361,0.800785071 9.161,0.132 C9.29247374,0.0108869595 9.47857352,-0.0308857001 9.64919735,0.0224173781 C9.81982119,0.0757204563 9.94904726,0.216001266 9.98819736,0.390417384 C10.0273475,0.564833501 9.97047374,0.746886966 9.839,0.868 C9.11068658,1.53896706 8.37934578,2.20664054 7.645,2.871 L7.583,2.927 C5.376,4.922 5.287,5 5,5 C4.713,5 4.624,4.922 2.417,2.927 L2.355,2.871 C1.62081041,2.20646869 0.889470368,1.5387959 0.161,0.868 C-0.0422407879,0.68077547 -0.0552245302,0.364240788 0.132,0.161 C0.31922453,-0.0422407879 0.635759212,-0.0552245302 0.839,0.132 C1.5649901,0.800955473 2.29399753,1.46662893 3.026,2.129 L3.088,2.185 C3.693,2.733 4.203,3.187 4.583,3.519 C4.75,3.665 4.89,3.785 5,3.877 C5.11,3.785 5.25,3.665 5.417,3.519 Z' id='a'%3E%3C/path%3E%3C/g%3E%3Cg id='Clipped'%3E%3Cmask id='mask-2' fill='white'%3E%3Cuse xlink:href='%23path-1'%3E%3C/use%3E%3C/mask%3E%3Cg id='a'%3E%3C/g%3E%3Cg id='Group' mask='url(%23mask-2)' fill='%23292827' fill-rule='nonzero'%3E%3Cg transform='translate(-5.000000, -8.000000)' id='Shape'%3E%3Cpolygon points='0 0 20 0 20 20 0 20'%3E%3C/polygon%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E\")"
410
417
, backgroundRepeat: " no-repeat"
411
418
, backgroundPositionY: " 16px"
@@ -415,27 +422,37 @@ styles = jss
415
422
}
416
423
417
424
, " &:hover lumi-select-input" : lumiInputHoverStyles
418
- , " &:focus lumi-select-input, & lumi-select-inner[data-focus=\" true\" ] lumi-select-input" : lumiInputFocusStyles
425
+
426
+ , " &:focus lumi-select-input, & lumi-select-inner[data-focus=\" true\" ] lumi-select-input" :
427
+ { extend: lumiInputFocusStyles
428
+ , " & lumi-select-input-placeholder" :
429
+ { display: " none"
430
+ }
431
+ }
432
+
419
433
, " &[data-disabled=\" true\" ] lumi-select-input" : lumiInputDisabledStyles
420
434
421
435
, " & lumi-select-input-selected-values" :
422
436
{ margin: " -2px" -- (gap)
423
437
424
438
, display: " flex"
425
439
, flexFlow: " row wrap"
426
- , flex: " 1"
440
+ , flex: " 1 1 auto"
441
+ , minWidth: 0
427
442
428
443
, " & > lumi-select-input-selected-value, & > lumi-select-input-placeholder, & > input.select-native-input" :
429
444
{ margin: " 2px" -- (gap)
430
445
}
431
- , " & > lumi-select-input-placeholder" :
432
- { position: " absolute"
433
- }
434
446
}
435
447
436
448
, " & lumi-select-input-placeholder" :
437
449
{ color: cssStringHSLA colors.black2
438
450
, lineHeight: " 32px"
451
+ , flex: " 1 1 0%"
452
+ , display: " block"
453
+ , overflow: " hidden"
454
+ , whiteSpace: " nowrap"
455
+ , textOverflow: " ellipsis"
439
456
, " @media (min-width: 860px)" :
440
457
{ lineHeight: " 24px"
441
458
}
@@ -444,22 +461,30 @@ styles = jss
444
461
445
462
, " & lumi-select-input-selected-value" :
446
463
{ display: " flex"
464
+ , flex: " 0 1 auto"
447
465
, flexFlow: " row"
448
466
, alignItems: " center"
449
467
, padding: " 0 7px"
468
+ , minWidth: 0
450
469
, lineHeight: " 32px"
451
470
, " @media (min-width: 860px)" :
452
471
{ lineHeight: " 24px"
453
472
}
473
+ , " & > lumi-select-input-selected-value-text" :
474
+ { display: " block"
475
+ , lineHeight: " inherit"
476
+ , overflow: " hidden"
477
+ , whiteSpace: " nowrap"
478
+ , textOverflow: " ellipsis"
479
+ }
454
480
, " & > lumi-select-clear-icon" : { display: " none" }
455
481
}
456
482
, " & lumi-select-input-selected-value + input.select-native-input" :
457
483
{ visibility: " hidden"
458
484
}
459
485
460
486
, " & input.select-native-input" :
461
- { flex: " 1"
462
- , width: " 100%"
487
+ { flex: " 1 1 0%"
463
488
, minWidth: " 40px"
464
489
, appearance: " none"
465
490
, border: " none"
@@ -477,6 +502,7 @@ styles = jss
477
502
, cursor: " pointer"
478
503
, height: " 26px"
479
504
, width: " 20px"
505
+ , flex: " 0 0 auto"
480
506
, paddingTop: " 3px"
481
507
, " @media (min-width: 860px)" :
482
508
{ paddingTop: " 0"
@@ -504,13 +530,15 @@ styles = jss
504
530
, " & lumi-select-input-selected-value + input.select-native-input" :
505
531
{ visibility: " visible"
506
532
, padding: " 0 7px 0 1px"
533
+ }
507
534
508
- -- hide the blank input line when not in focus
509
- , " &[value=\"\" ]:not(:focus)" :
510
- { flex: " unset"
511
- , width: " 0"
512
- , minWidth: " 0"
513
- }
535
+ -- hide the blank input line when not in focus
536
+ , " & input.select-native-input[value=\"\" ]:not(:focus)" :
537
+ { width: 0
538
+ , minWidth: 0
539
+ , padding: 0
540
+ , margin: 0
541
+ , flex: " 0 1 0%"
514
542
}
515
543
}
516
544
@@ -595,7 +623,7 @@ styles = jss
595
623
, display: " flex"
596
624
, flexFlow: " column"
597
625
, justifyContent: " center"
598
- , padding: " 0 9px"
626
+ , padding: " 6px 9px"
599
627
, minHeight: " 32px"
600
628
, cursor: " initial"
601
629
, overflow: " hidden"
0 commit comments