Skip to content
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

placeholder on page not show 100% for select multiple #1228

Open
016 opened this issue Oct 29, 2024 · 0 comments
Open

placeholder on page not show 100% for select multiple #1228

016 opened this issue Oct 29, 2024 · 0 comments
Labels

Comments

@016
Copy link

016 commented Oct 29, 2024

Describe the bug
when I try to adding Choices-js to my working project(Chinese), I found the placeholder only show a part on page, not 100%, you can check the screenshots pic direct. I did more test, it's working for English placeholder, also working for Chinese placeholder when remove "multiple". btw I am using bootstrap 5.3.

To Reproduce
Steps to reproduce the behavior:

  1. import
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/choices.js@11.0.2/public/assets/styles/choices.min.css">
    <script src="https://cdn.jsdelivr.net/npm/choices.js@11.0.2/public/assets/scripts/choices.min.js"/></script

  2. select tag
    <div class="col-md-6">
    <label for="city-select" class="form-label">选择城市</label>
    <select id="city-select" multiple class="form-select">
    <option value="北京">北京</option>
    <option value="纽约">纽约</option>
    </select>

</div>
4. js init code

// 初始化Choices.js
const choices = new Choices('#city-select', {
  removeItemButton: true,
  maxItemCount: 3,
  searchEnabled: true,
  placeholder: true,
  placeholderValue: '最多选择3个城市',
  noResultsText: 'not found.',
  loadingText: 'loading...',
  resetScrollPosition: false,
});

Expected behavior
show full placeholder with input width just like En.

Screenshots
SCR-20241029-mczu
SCR-20241029-mcsl
SCR-20241029-mhcq

Choices version and bundle

  • Version: [e.g. v11.0.2 choices.min.js]

Desktop (please complete the following information):

  • OS: macos
  • Browser chrome + safari

Quick fix
.choices__input{ width:100%!important; }

thx for your work, the lib is very good for me, just carry on.

@016 016 added the bug label Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant