-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Select list dropdown scrollbar closes the dropdown. #901
Comments
The scrollbar on dropdowns worked for me on Chrome + OSX. What browser/OS are you on? |
Chrome on Windows 7 with the latest release build of Materialize v0.95.3. I set the height on the list to 200px, and made sure the overflow was on auto. Perhaps there is a better way to display the scrollbar by limiting the list items shown, instead of using a css height? |
Same problem for me. The problem is located here : The blur event is fired once we click on the scrollbar. |
Is this issue resolved? If it is resolved where i can find solution. |
I did this and it works Fine // $newSelect.on('blur', function(){ Comment out the on blur after that every click of options will get the value and close the dropdown. |
if you want to exit the dropdown when you click outside Use this.
|
Thank you very much. It is working as expected. |
Only to add the following '+' code after $('select').material_select(), without any patch to materialize.js.
|
My PR was rejected because of the following reason.
Such problem doesn't occur on my environment. Could anyone help me to test this additionally? |
Hi chi-bd, I test your solution
and not work for me on IE 10, because after select an item select not close automatically. Without your solution after you select an item the select close auto. |
Dear blinchi, thanks for testing.
I can't reproduce it for lack of IE10 environment, but I probably found a way to close forcibly.
material_select() can be received the callback function as an argument, and it calls when the item has selected. |
We have the same issue, but only on IE (at least 10 & 11). @chi-bd Thanks for the workarounds, combining both seems to works as expected.
|
@sly7-7 ouhhh yeahhh your code Works perfect! |
@sly7-7 - Looks like if you have more than one select list vertically, opening the drop down below and then opening the one above causes layering issues with both dropdowns. Didn't know if you experienced this issue and potential workarounds. update:
|
@sly7-7 -- Your fix worked, but makes it so that you can no longer begin typing to jump to a specific dropdown option. :( Thoughts? |
On mobile does not work at all! Any thoughts? |
I have a dropdown that dissapears when clicked on mobile as well.. |
This was fixed in 1d94110 |
After upgrading to 0.98.1, I am still seeing this issue in IE 11 (11.0.9600.18617) on Windows 7. It works fine in Chrome (57.0.2987.110). |
Hi there, I found a workaround for mobile devices. var onMouseDown = function(e) {
// added to trigger all other select lists to close
$("input[data-activates!='" + $(this).attr('data-activates') + "'].select-dropdown").trigger('close');
// preventing the default still allows the scroll, but blocks the blur.
// We're inside the scrollbar if the clientX is >= the clientWidth.
if (e.clientX >= e.target.clientWidth || e.clientY >= e.target.clientHeight) {
// Apply only on non-touch screen devices.
if('ontouchstart' in document.documentElement) {
e.preventDefault();
}
}
}; |
Interesting solution; does this take into account a regular scroll wheel
when inside the element instead of when my cursor is inside of the
scrollbar?
…On Thu, Apr 20, 2017 at 7:57 AM kevzlou7979 ***@***.***> wrote:
Hi there,
I found a workaround for mobile devices.
We used Materialize on Java Web Application also know as GWT
Check it out : http://gwtmaterialdesign.github.io/gwt-material-demo/
var onMouseDown = function(e) {
// added to trigger all other select lists to close
$("input[data-activates!='" + $(this).attr('data-activates') + "'].select-dropdown").trigger('close');
// preventing the default still allows the scroll, but blocks the blur.
// We're inside the scrollbar if the clientX is >= the clientWidth.
if (e.clientX >= e.target.clientWidth || e.clientY >= e.target.clientHeight) {
// Apply only on non-touch screen devices.
if('ontouchstart' in document.documentElement) {
e.preventDefault();
}
}
};
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#901 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA6Tha4QSNcnhh-7-R21IMs1NYA_mUa4ks5rx0ghgaJpZM4DtwPX>
.
|
@tdotholla Yeah both Scroll wheel and cursor is working fine |
The issue is still present in IE11. I'm using v0.98.0 |
Version 0.100.1, issue remains (IE10, IE11) |
Is there any chance of a solution for this? Still a problem in IE11 |
@cpalmerbright I also have this problem in IE11, did you find a fix? |
It would appear that IE fire's a blur event that other browsers do not fire on click of the scroll bar. Search for this function: Notice this line: This is the event that is closing the drop-down in IE. We fixed this behaviour using this code:
This needs further testing I guess to ensure that it doesn't have any unwanted side effects but initially, this seems to fix the issue. |
We have a fix coming for this in v1 with a reworked select that does not rely on focus |
Any ETA on V1? |
@Fasani unfortunately ugly solution, but it's better than nothing. Anyone got any news on this? |
@sly7-7 It is not working in Safari. this is the code
|
Many above methods work, but if we do e.preventDefault(); then we lose the browser typing context ability. I mean if you type a letter, the select wont go to the item anymore, any workaround with this? |
Hi i'm using Downshift material ui component. |
I have a select list of US states which requires a scrollbar to limit the items shown to 7 or so. However, using the scrollbar immediately closes the droplist. The folks at the Angular/material git have a fix, but I don't understand how to implement it for the select list dropdown. Thanks in advance! angular/material#1739 The following is exactly what's happening:
The text was updated successfully, but these errors were encountered: