Comments (2)
I have the same problem here. But i found out a simple solution (using jquery), it follows:
I changed the bindHandlers in 2 different positions (i didnt checkout the touchhandlers).
On self.$container click i changed this:
if(!self.down) {
self.open();
} else {
self.close();
};
into this:
if($(self.$select).attr('disabled') == undefined) {
if(!self.down) {
self.open();
} else {
self.close();
};
}
But it will not work if just that, you need to tell the body click not to close your select if you clicked into your select (classes: carat or selected).
Here's my new body click:
$('body').on('click',function(e) {
var
if(targetClasses == undefined || (targetClasses.indexOf('carat') == -1 && targetClasses.indexOf('selected') == -1)) {
var classNames = "."+self.wrapperClass.split(' ').join('.');
if(!$target.closest(classNames).length && self.down){
self.close();
};
}
});
Sry about code formatting.
Hope it helps.
from easydropdown.
Thanks guys,
I've added support for the disabled attribute on the select element (not the individual options yet) in v2.0.6
I've also added disable/enable methods we can use to programmatically disable the drop-down.
from easydropdown.
Related Issues (20)
- Bug: both of the selects (native and custom) appear on iPad HOT 2
- Plugin API not working on touch devices
- BEM CSS naming convention can be used
- Unexpected keyboard behavior (in relation to `[ Enter ]` / `[ Return ]`): delay and reset of value
- dinamically adding easydropdowns doesn't work on android chrome HOT 2
- Dependent DropDowns
- FormData disappears when using keyboard to select option
- Webpack resolve error HOT 4
- Bug in Firefox HOT 3
- Bug in firefox HOT 2
- npm package has no styles HOT 3
- Possible to have a closeOnBlur option? HOT 3
- onSelect callback no longer works when openOnFocus is set HOT 1
- onChange event firing even when value is not changed HOT 1
- Different value on dropdown HOT 5
- How to properly add a label? HOT 1
- Select not working on safari. HOT 1
- clampMaxVisibleItems not working with multiline options HOT 1
- Trigger Invalid / Add dynamic classes to edd-head & edd-root HOT 2
- Installing in Rails 5 or 6? HOT 6
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 easydropdown.