-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Mouseenter (selection) doesn't work in 1.2.16+ using IE8 #158
Comments
I don't know if my issue is related or not, but I can't get the select to work on IE8 for any version later than 0.2.1. This is the last version that works in IE8 that I can test. I have to use Angular 1.2.16 with this because of the bug that was fixed with ng-transclude. What happens to me is that I click on an element and it doesn't actually select anything. After I click on the first element, then it seems to actually select that one but then I get a ng-change event for what seems to be every single element in the list, which blows up my application. I tried angular-ui-select 0.7.0 with Angular 1.2.16, but it doesn't work (doesn't display content inside of the templates, so dropdown is empty), so I can't isolate the selection issue between Angular upgrade and angular-ui-select upgrade. |
I think my issue is different, I do see it's always setting the last item active. It's actually the ng-click that isn't working, and I'm not sure why, maybe the a's href for javascript:void(0) is eating the event somehow, not sure. I actually can 95% workaround the issues by adding my own ng-click and ng-mouseenter events myself to the transcluded content. The issue is that there are wrapper elements around them, like the a tag, which has visible space surrounding the parts that I can control. The fact that I can work-around this is sort of surprising. scope.selItem = function($select, $event, item) {
$event.stopPropagation();
//do work with item, as I would with ng-change
$select.select(loc); //needed to make the dropdown disappear
} <ui-select-choices ng-mouseenter="$event.stopPropagation()" repeat="item in items | filter: $select.search">
<div render-item="item" ng-click="selLoc($select, $event, item)" ng-mouseenter="$event.stopPropagation()"></div>
</ui-select-choices> |
I am not fully sure why the below worked but adding the ng-mouseenter and ng-click events to the rowsInner instead of the choices solved this issue in IE8 for me. I'll continue to look into why this works and post back when I can confirm the reason this resolves this issue. Existing Code:
Code after I made the changes:
|
…in issue angular-ui#158 (reference to angular-ui#118 and angular-ui#120)
Any chance this will get added to a release? |
I had the same issue. This fix worked for me. It will be great if it is included in some future release. |
I created a pull request with the event delegation fixes from @jlfama fork. The indexOf issues can be fixed by including an ie8 shim. |
Eh, I think most of us are on 1.3 ( which drops IE8 support ) ... maybe maintain a separate branch for IE8'ers? |
ie8 fix: angular-ui#158 picked: 8be220f patch from @dhonn
ie8 fix: angular-ui#158 picked: 8be220f patch from @dhonn
@careywalker, your code (minor modification based on version) worked for me with 0.9.6. (EDIT) This would apply cleanly also to the latest version (v0.11.1) -- no merge conflicts. Would it be worth trying another pull request on the current version? I also haven't taken time to see why it fixes the issue in IE8, but it doesn't break anything for me, in my project, in latest IE, Chrome, or FF. |
angular-ui#158, based on an observed (but maybe not well understood) code change by @careywalker. Basically, just move the ng-click/ng-mouseenter bindings from the LI (choices-row) to the contained DIV (choices-row-inner). So far, I haven't seen an affect on behavior in any browser, but this is with light manual testing. All automated tests pass with these changes in place: >gulp test [15:05:36] Using gulpfile C:\web\sites\ui-select\gulpfile.js [15:05:36] Starting 'clean'... [15:05:36] Finished 'clean' after 14 ms [15:05:36] Starting 'scripts'... [15:05:36] Starting 'styles'... [15:05:36] Finished 'styles' after 61 ms [15:05:37] Finished 'scripts' after 1.01 s [15:05:37] Starting 'build'... [15:05:37] Finished 'build' after 14 μs [15:05:37] Starting 'karma'... [15:05:38] Finished 'karma' after 880 ms [15:05:38] Starting 'test'... [15:05:38] Finished 'test' after 5.63 μs INFO [karma]: Karma v0.12.31 server started at http://localhost:9876/ INFO [launcher]: Starting browser Chrome INFO [Chrome 41.0.2272 (Windows 7)]: Connected on socket gaw3nxxZW2Omee4BBX-X with id 17666700 Chrome 41.0.2272 (Windows 7): Executed 110 of 110 SUCCESS (2.483 secs / 2.465 secs)
#754 seems to work for me. We have no choice to support IE8 and IE11 now during a enterprise migration to IE11, and Angular 1.2.16 has a bug impacting IE11, but upgrading beyond select 0.2 doesn't work in IE8, and it doesn't work in Angular past 1.2.16. So now we will use @Josh68's code with Angular 1.2.28, the last Angular version supporting IE8. Once the IE8 merge is complete, we can upgrade to latest Angular and mainline ui-select. |
Josh68@8317a0c angular js 1.2.28 Thank you. |
On mouseenter the selected item moves to the last one. The mouseover event fires for each row in the collection - always leaving the last one selected.
Current work-around is to use 1.2.15.
The text was updated successfully, but these errors were encountered: