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

Drop Down Scrollbars do not Work in IE #21

Open
scirelli opened this issue Feb 23, 2016 · 13 comments
Open

Drop Down Scrollbars do not Work in IE #21

scirelli opened this issue Feb 23, 2016 · 13 comments

Comments

@scirelli
Copy link

When trying to scroll through a list in IE Edge (11), you can't do it, the drop down just closes.
http://plnkr.co/edit/1pvaCDBDEJSwUlFeaieS?p=preview

In the above plunker, uncheck the disabled box, click on the selectbox, try to use the mouse to scroll through the items in the list.

@indrimuska
Copy link
Owner

Thank you @scirelli for reporting this. Unfortunately I can't verify the issue at the moment, since I don't have any PC with IE Edge installed. Do you see the problem even in the demo page?

@scirelli
Copy link
Author

I had to install a VM to test it myself. I'll take a look when I get on the laptop I installed the VM on.

You can Google for MS window IE11 Virtual machine. You'll get the Windows dev sit with vms you can download.
https://dev.windows.com/en-us/microsoft-edge/tools/vms/linux/

@indrimuska
Copy link
Owner

Oh good, thank you for the tip! I will try it soon ;)

@scirelli
Copy link
Author

Just tried the demo page. Same issue. Scroll bars don't work. I guess the
scroll bar is outside the drop down area? Clicking outside hides the drop
down.

@scirelli
Copy link
Author

I wrote a quick hack to try and get this to work in IE. It's not pretty, and I'm sure it's not efficient but maybe you can improve on it.

Here's the merge on my fork.

Not sure why the indentations are messed up. I use spaces....

I don't want to pull request to your repo because I had forked yours, but for some reason your's was different from the bower version I got? So instead of trying to figure out where the bower one came from I just copied it's source over.

Anyway, at the very least it should give you some ideas on how to fix this in IE :)

@indrimuska
Copy link
Owner

Yes, of course! Thank you for posting this, it would be very helpful.
I'm going to install a vm with W10 and IE Edge, so that I can take a look and then I'll come back to you. :)

@indrimuska
Copy link
Owner

Here I am again. I've just installed Windows 10 Pro, but I am unable to reproduce the issue with Microsoft Edge, not even with IE 11. Maybe it may depends on the installed version of these browsers.
Here it is my situation.

Microsoft Edge
schermata 2016-02-26 alle 10 56 20
Internet Explorer 11
schermata 2016-02-26 alle 10 55 55

@scirelli
Copy link
Author

I'm running the Windows 7 vm. You clicked and dragged on the scroll bar and it worked? Can you send me the plunker link?

selection_001 png

@indrimuska
Copy link
Owner

Last tests have been made with Windows 10 on the demo page and everything looks fine.
I've just installed a Windows 7 vm but, as for Windows 10, the scrollbar works very well.
Here it is the version of my IE.

schermata 2016-02-29 alle 17 06 31

@scirelli
Copy link
Author

Idk, I still can't get it to work on the Win7 VM. Slightly different version
screen shot 2016-02-29 at 2 56 39 pm

@tkahn
Copy link

tkahn commented Nov 15, 2016

I can verify that this is a bug on Windows 7 IE11. We are two independent testers that have seen the same issue and the problem is that the blur event tied to the input is triggered when the user interacts with the scrollbar.

actias pushed a commit to actias/angular-selector that referenced this issue Jan 9, 2017
…- Dropdown closing on scroll click in IE and Edge
@actias
Copy link

actias commented Jan 9, 2017

Hi! I love your project. It's literally exactly what I've been looking for in my app for some time. I did some digging and it looks like the problem is with IE/Edge. Whenever you click on a scrollbar, it will remove focus from the input.

I modified the section of code that controls this to fix this issue with IE/Edge without affecting other browsers.

Here's the fix for anyone that's interested.

// DOM event listeners

scope.preventClose = false; /// This is a variable that tracks where or not to prevent the window from closing.

input = angular.element(element[0].querySelector('.selector-input input'))
	.on('focus', function () {
		
		if(scope.preventClose) {
			scope.preventClose = false;
			return;
		}
		
		$timeout(function () {
			scope.$apply(scope.open);
		});
	})
	.on('blur', function () {
		
		if(scope.preventClose) {
			input.focus();
			return;
		}
		
		scope.$apply(scope.close);
	})
	.on('keydown', function (e) {
		scope.$apply(function () {
			scope.keydown(e);
		});
	})
	.on('input', function () {
		scope.setInputWidth();
	});
dropdown
	.on('mousedown', function (e) {
		scope.preventClose = true; /// Mousedown on the dropdown will prevent this.
		e.preventDefault();
	});
angular.element($window)
	.on('resize', function () {
		scope.dropdownPosition();
	});

@jeeyyy
Copy link

jeeyyy commented Jan 29, 2018

This is fixed in a high performance variant/fork of the same component:
https://github.com/jkodu/angular-selector-on-steroids

Refer enhanced example page - https://jkodu.github.io/angular-selector-on-steroids/ (allow unsafe scripts).

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

No branches or pull requests

5 participants