Skip to content

Commit 9c448b0

Browse files
authored
Update form-timepicker.js
1 parent b32094a commit 9c448b0

File tree

1 file changed

+28
-24
lines changed

1 file changed

+28
-24
lines changed

src/components/form-timepicker/form-timepicker.js

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -410,32 +410,36 @@ export const BFormTimepicker = /*#__PURE__*/ Vue.extend({
410410
)
411411
}
412412

413-
const closeLabel = this.labelCloseButton
414-
$controls.push(
415-
h(
416-
BButton,
417-
{
418-
props: { size: 'sm', disabled: this.disabled, variant: this.closeButtonVariant },
419-
attrs: { 'aria-label': closeLabel || null },
420-
on: { click: this.onCloseButton }
421-
},
422-
closeLabel
413+
if (!this.noCloseButton) {
414+
const closeLabel = this.labelCloseButton
415+
$controls.push(
416+
h(
417+
BButton,
418+
{
419+
props: { size: 'sm', disabled: this.disabled, variant: this.closeButtonVariant },
420+
attrs: { 'aria-label': closeLabel || null },
421+
on: { click: this.onCloseButton }
422+
},
423+
closeLabel
424+
)
423425
)
424-
)
426+
}
425427

426-
$controls = [
427-
h(
428-
'div',
429-
{
430-
staticClass: 'b-form-date-controls d-flex flex-wrap',
431-
class: {
432-
'justify-content-between': $controls.length > 1,
433-
'justify-content-end': $controls.length < 2
434-
}
435-
},
436-
$controls
437-
)
438-
]
428+
if ($controls.length > 0) {
429+
$controls = [
430+
h(
431+
'div',
432+
{
433+
staticClass: 'b-form-date-controls d-flex flex-wrap',
434+
class: {
435+
'justify-content-between': $controls.length > 1,
436+
'justify-content-end': $controls.length < 2
437+
}
438+
},
439+
$controls
440+
)
441+
]
442+
}
439443

440444
const $time = h(
441445
BTime,

0 commit comments

Comments
 (0)