@@ -370,20 +370,20 @@ export const BFormDatepicker = /*#__PURE__*/ Vue.extend({
370
370
render ( h ) {
371
371
const size = this . size
372
372
const state = this . state
373
+ const visible = this . visible
374
+ const isHovered = this . isHovered
375
+ const hasFocus = this . hasFocus
373
376
const localYMD = this . localYMD
374
377
const disabled = this . disabled
375
378
const readonly = this . readonly
379
+ const required : this . required
380
+ // These should move moved into computed props
376
381
const idButton = this . safeId ( )
377
382
const idLabel = this . safeId ( '_value_' )
378
383
const idMenu = this . safeId ( '_dialog_' )
379
384
const idWrapper = this . safeId ( '_b-form-date_' )
380
385
381
- let $button = h ( 'div' , { attrs : { 'aria-hidden' : 'true' } } , [
382
- this . isHovered || this . hasFocus
383
- ? h ( BIconCalendarFill , { props : { scale : 1.25 } } )
384
- : h ( BIconCalendar , { props : { scale : 1.25 } } )
385
- ] )
386
- $button = h (
386
+ const $button = h (
387
387
'button' ,
388
388
{
389
389
ref : 'toggle' ,
@@ -394,9 +394,9 @@ export const BFormDatepicker = /*#__PURE__*/ Vue.extend({
394
394
type : 'button' ,
395
395
disabled : disabled ,
396
396
'aria-haspopup' : 'dialog' ,
397
- 'aria-expanded' : this . visible ? 'true' : 'false' ,
397
+ 'aria-expanded' : visible ? 'true' : 'false' ,
398
398
'aria-invalid' : state === false ? 'true' : null ,
399
- 'aria-required' : this . required ? 'true' : null
399
+ 'aria-required' : required ? 'true' : null
400
400
} ,
401
401
on : {
402
402
mousedown : this . onMousedown ,
@@ -406,7 +406,12 @@ export const BFormDatepicker = /*#__PURE__*/ Vue.extend({
406
406
'!blur' : this . setFocus
407
407
}
408
408
} ,
409
- [ $button ]
409
+ [
410
+ h ( isHovered || hasFocus ? BIconCalendarFill : BIconCalendar , {
411
+ props : { scale : 1.25 } ,
412
+ attrs : { 'aria-hidden' : 'true' }
413
+ } )
414
+ ]
410
415
)
411
416
412
417
// Label as a "fake" input
@@ -428,7 +433,7 @@ export const BFormDatepicker = /*#__PURE__*/ Vue.extend({
428
433
dir : this . isRTL ? 'rtl' : 'ltr' ,
429
434
lang : this . localLocale || null ,
430
435
'aria-invalid' : state === false ? 'true' : null ,
431
- 'aria-required' : this . required ? 'true' : null
436
+ 'aria-required' : required ? 'true' : null
432
437
} ,
433
438
on : {
434
439
// Disable bubbling of the click event to
@@ -440,7 +445,7 @@ export const BFormDatepicker = /*#__PURE__*/ Vue.extend({
440
445
} ,
441
446
[
442
447
// Add the formatted value or placeholder
443
- localYMD ? this . formattedValue : this . placeholder || this . labelNoDateSelected ,
448
+ localYMD ? this . formattedValue : this . placeholder || this . labelNoDateSelected || '\u00A0' ,
444
449
// Add an sr-only 'selected date' label if a date is selected
445
450
localYMD ? h ( 'span' , { staticClass : 'sr-only' } , ` (${ this . labelSelected } ) ` ) : h ( )
446
451
]
@@ -485,7 +490,7 @@ export const BFormDatepicker = /*#__PURE__*/ Vue.extend({
485
490
h (
486
491
BButton ,
487
492
{
488
- props : { size : 'sm' , disabled : this . disabled , variant : this . closeButtonVariant } ,
493
+ props : { size : 'sm' , disabled : disabled , variant : this . closeButtonVariant } ,
489
494
attrs : { 'aria-label' : label || null } ,
490
495
on : { click : this . onCloseButton }
491
496
} ,
@@ -532,7 +537,7 @@ export const BFormDatepicker = /*#__PURE__*/ Vue.extend({
532
537
ref : 'menu' ,
533
538
staticClass : 'dropdown-menu p-2' ,
534
539
class : {
535
- show : this . visible ,
540
+ show : visible ,
536
541
'dropdown-menu-right' : this . right ,
537
542
'bg-dark' : this . dark ,
538
543
'text-light' : this . dark
@@ -569,8 +574,8 @@ export const BFormDatepicker = /*#__PURE__*/ Vue.extend({
569
574
class : [
570
575
this . directionClass ,
571
576
{
572
- show : this . visible ,
573
- focus : this . hasFocus ,
577
+ show : visible ,
578
+ focus : hasFocus ,
574
579
[ `form-control-${ size } ` ] : ! ! size ,
575
580
'is-invalid' : state === false ,
576
581
'is-valid' : state === true
@@ -583,7 +588,7 @@ export const BFormDatepicker = /*#__PURE__*/ Vue.extend({
583
588
'aria-readonly' : readonly && ! disabled ,
584
589
'aria-labelledby' : idLabel ,
585
590
'aria-invalid' : state === false ? 'true' : null ,
586
- 'aria-required' : this . required ? 'true' : null ,
591
+ 'aria-required' : required ? 'true' : null ,
587
592
// We don't want the flex order to change here
588
593
// So we always use 'ltr'
589
594
dir : 'ltr'
0 commit comments