Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix($sniffer): IE9 backspace bug in compatibility mode #7263

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/ng/sniffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ function $SnifferProvider() {
// IE8 compatible mode lies
(!documentMode || documentMode > 7),
hasEvent: function(event) {
// IE9 implements 'input' event it's so fubared that we rather pretend that it doesn't have
// it. In particular the event is not fired when backspace or delete key are pressed or
// when cut operation is performed.
if (event == 'input' && msie == 9) return false;
// IE9 (and some other versions in compatiblity mode) implements 'input' event but it's so
// fubared that we rather pretend that it doesn't have it. In particular the event is not fired
// when backspace or delete key are pressed or when cut operation is performed.
if (event == 'input' && msie <= 9) return false;

if (isUndefined(eventSupport[event])) {
var divElm = document.createElement('div');
Expand Down
2 changes: 1 addition & 1 deletion test/ng/snifferSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe('$sniffer', function() {
// IE9 implementation is fubared, so it's better to pretend that it doesn't have the support
mockDivElement = {oninput: noop};

expect($sniffer.hasEvent('input')).toBe((msie == 9) ? false : true);
expect($sniffer.hasEvent('input')).toBe((msie <= 9) ? false : true);
});
});

Expand Down