Skip to content

Commit f0d8ffe

Browse files
fix(b-calendar, b-form-datepicker): minor adjustments to styling and example updates (#5211)
* fix(b-calendar, b-form-datepicker): minor adjustments to styling * Update form-datepicker.js * Update README.md Co-authored-by: Jacob Müller <[email protected]>
1 parent 9018221 commit f0d8ffe

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-1
lines changed

src/components/calendar/_calendar.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@
3737
// Easy rounded corners on contained elements,
3838
// specifically the footer of the calendar grid
3939
overflow: hidden;
40+
41+
.row {
42+
// Prevent grid rows from wrapping
43+
flex-wrap: nowrap;
44+
}
4045
}
4146

4247
.b-calendar-grid-caption {

src/components/form-datepicker/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,39 @@ You can use the `isRTL` scoped property to "flip" the prev vs next button conten
481481
left-to-right to right-to-left orientation change &mdash; i.e. the previous year button will be on
482482
the right when `isRTL` is `true`, instead of the left.
483483

484+
### Full width calendar dropdown
485+
486+
To create a full width calendar dropdown (where the width matches the input width), simply set the
487+
`menu-class` prop to `'w-100'` and set the `calendar-width` prop to `'100%'`:
488+
489+
```html
490+
<template>
491+
<div>
492+
<label for="datepicker-full-width">Choose a date</label>
493+
<b-form-datepicker
494+
id="datepicker-full-width"
495+
v-model="value"
496+
menu-class="w-100"
497+
calendar-width="100%"
498+
class="mb-2"
499+
></b-form-datepicker>
500+
<p>Value: '{{ value }}'</p>
501+
</div>
502+
</template>
503+
504+
<script>
505+
export default {
506+
data() {
507+
return {
508+
value: ''
509+
}
510+
}
511+
}
512+
</script>
513+
514+
<!-- b-form-datepicker-full-width.vue -->
515+
```
516+
484517
## Internationalization
485518

486519
Internationalization of the date picker's calendar is provided via

src/components/form-datepicker/form-datepicker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ export const BFormDatepicker = /*#__PURE__*/ Vue.extend({
530530
{
531531
key: 'calendar',
532532
ref: 'calendar',
533-
staticClass: 'b-form-date-calendar',
533+
staticClass: 'b-form-date-calendar w-100',
534534
props: this.calendarProps,
535535
on: {
536536
selected: this.onSelected,

0 commit comments

Comments
 (0)