Skip to content

Datepicker styling is broken (wrong width?) #5210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
digitalcortex opened this issue Apr 21, 2020 · 6 comments
Closed

Datepicker styling is broken (wrong width?) #5210

digitalcortex opened this issue Apr 21, 2020 · 6 comments

Comments

@digitalcortex
Copy link

digitalcortex commented Apr 21, 2020

Describe the bug

In our project we are trying to use datepicker but it keeps having broken layout. Please see the screenshots attached for details. Increasing style width of the element with id: "_BVID__73__calendar-wrapper" seems to be solving the issue but it can't be done via Vue code without dirty hacks.

Steps to reproduce the bug

Add a datepicker vue component to your view.
<b-form-group label="Date of Birth" label-for="edit-input-dateofbirth" class="mr-2"> <b-form-datepicker id="edit-input-dateofbirth" v-model="form.dateOfBirth" ></b-form-datepicker> </b-form-group>

Expected behavior

Layout supposed to be correct (like in examples)

Versions

Libraries:

  • BootstrapVue: 2.11.0
  • Bootstrap: 4.4.1
  • Vue: 2.6.11

Environment:

  • Device: Mac
  • OS: macOS Mojave
  • Browser: Brave
  • Version: Version 1.4.96 Chromium: 80.0.3987.132 (Official Build) (64-bit)

Additional context

I'm attaching the screenshots with details:
calendar-broken
incorrect width
solution

@tmorehouse
Copy link
Member

tmorehouse commented Apr 21, 2020

Try upgrading to BootstrapVue version 2.12.0, which has some fixes for Datepicker styles.

It sounds like you might have customized padding/margin SCSS variables (the base $spacer value).

Related issue: #5117
Related Fix PR: #5121
Fix Released in BootstrapVue v2.12.0

Also note that there is a calendar-width prop on <b-form-datepicker> (introduced in v2.6.0) that defaults to 270px

@digitalcortex
Copy link
Author

Try upgrading to BootstrapVue version 2.12.0, which has some fixes for Datepicker styles.

It sounds like you might have customized padding/margin SCSS variables (the base $spacer value).

Related issue: #5117
Related Fix PR: #5121
Fix Released in BootstrapVue v2.12.0

Also note that there is a calendar-width prop on <b-form-datepicker> (introduced in v2.6.0) that defaults to 270px

Thank you tmorehouse, I updated to 2.12.0 and used calendar-width property. It works fine now. However after update the field itself started looking weird (icon is below the field, field is bigger than others). It happened just after update. How to fix it?
offset

@digitalcortex
Copy link
Author

digitalcortex commented Apr 21, 2020

Try upgrading to BootstrapVue version 2.12.0, which has some fixes for Datepicker styles.

It sounds like you might have customized padding/margin SCSS variables (the base $spacer value).

Related issue: #5117
Related Fix PR: #5121
Fix Released in BootstrapVue v2.12.0

Also note that there is a calendar-width prop on <b-form-datepicker> (introduced in v2.6.0) that defaults to 270px

By the way, I did not touch $spacer value at all.

@tmorehouse
Copy link
Member

Make sure you are using the latest BootstrapVue v2.12.0 CSS as well (and that it is included after Bootstrap v4.4 CSS is imported).

@digitalcortex
Copy link
Author

Make sure you are using the latest BootstrapVue v2.12.0 CSS as well (and that it is included after Bootstrap v4.4 CSS is imported).

I'm thankful, it worked!

@nikeza
Copy link

nikeza commented Nov 20, 2021

put in main.js :
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants