Comments (2)
+1
from bootstrap-select.
Change
var selectHeight = this.$newElement.outerHeight();
this.button = this.$newElement.find('> button');
if (id !== undefined) {
this.button.attr('id', id);
$('label[for="' + id + '"]').click(function(){ select.find('button#'+id).focus(); })
}
to this:
var selectHeight = this.$newElement.outerHeight();
var oldwidth = this.$element.width(); // ADD THIS LINE
this.$newElement.width(oldwidth); // ADD THIS LINE
this.button = this.$newElement.find('> button');
if (id !== undefined) {
this.button.attr('id', id).width(oldwidth); // CHANGE THIS LINE
$('label[for="' + id + '"]').click(function(){ select.find('button#'+id).focus(); })
}
I don't know how to do pulls and commits and merges and so on, but the above code seems to work with me... It just takes the current width of the select (that could be applied by separate css or inline) and applies it to the dropdown button (and its parent).
from bootstrap-select.
Related Issues (20)
- Layout/colors and form floating (bootstrap 5)
- Overlayproblem
- Missing empty line at the end of bootstrap-select.js
- it works very well (bootstrap-select-v1.14.0-beta3-updated and bootstrap 5.3.0) HOT 18
- Opening dropdown does not scroll to selected option first time, but does second time HOT 4
- Select with icon HOT 4
- Button onclick not working in latest version, worked fine in 1.12.4
- [email protected] not working with Bootstrap 5.3.2 HOT 4
- data-selected-text-format after render or refresh
- ADA improvements for Select/deselect all options
- Name of Ukrainian language file is wrong.
- Select does not display in dropdown-menu HOT 1
- is there any feature like select all HOT 1
- Unable to have noneSelectedText with HTML with latest version
- doneButtonText not in i18n files and no longer adjustable via Javascript defaults
- SweetAlert2 - bootstrap select dropdown appears behind/cutoff parent div border HOT 1
- Error when have a class attribute for optgroup tag
- wrong preview for > in <select class="form-control mobileSelect"> in Safari
- Turkish Case Sensitive
- I want to style the top div and add margin to it, unable to do so HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bootstrap-select.