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

isContentEditable always `true` on IE11 #367

Closed
Decklock opened this Issue Sep 6, 2017 · 5 comments

Comments

Projects
None yet
2 participants
@Decklock

Decklock commented Sep 6, 2017

Hi Tom,

I'm having trouble getting the typeahead plugin (2.9.0 dist) to run correctly in IE11 (specifically version 11.0.9600.18762).

For example, the following jsfiddle runs fine for me in Chrome (v58), but returns nothing at all in IE11...

When I trace the JavaScript, the issue appears appears to be the following section (line 716 673 of jquery.typeahead.js)...

   case "input":
      scope.deferred = $.Deferred();
      if (scope.node[0].isContentEditable) {
         scope.rawQuery = scope.node.text();
      } else {
         scope.rawQuery = scope.node.val().toString();
      }

IE11 returns true for isContentEditable, but scope.node.text() always returns an empty string no matter what is typed in for the search query.

Chrome returns false for isContentEditable, and then scope.node.val().toString() returns the correct query string.

Am I interpreting this right?

Note: The runningcoder.org Demo page works in IE11 because it's still running 2.8, I think.

Thanks in advance for the help! Let me know if you need any additional information for trouble-shooting.

-- Deck

@running-coder

This comment has been minimized.

Owner

running-coder commented Sep 6, 2017

hey @Decklock thanks for letting me know! adding support for contenteditable elements was just added in 2.9.0. As your investigation shows that might be the source of the issue... I should have expected IE to behave differently, will investigate this in priority

@running-coder running-coder added the Bug label Sep 6, 2017

@running-coder running-coder changed the title from IE11 compatibility with 2.9.0? to isContentEditable always `true` on IE11 Sep 6, 2017

running-coder added a commit that referenced this issue Sep 6, 2017

@running-coder

This comment has been minimized.

Owner

running-coder commented Sep 6, 2017

Could you have a look and confirm that the commit resolved the issue?

@Decklock

This comment has been minimized.

Decklock commented Sep 7, 2017

This version pops a new error for me on the href option...

Uncaught TypeError: Cannot read property 'generateHref' of undefined
at jquery.typeahead.min.js:10
at a.buildHtmlLayout (jquery.typeahead.min.js:10)
at a.buildLayout (jquery.typeahead.min.js:10)
at HTMLInputElement. (jquery.typeahead.min.js:10)
at HTMLInputElement.dispatch (jquery.min.js:7)
at HTMLInputElement.r.handle (jquery.min.js:7)
at Object.trigger (jquery.min.js:11)
at HTMLInputElement. (jquery.min.js:11)
at Function.each (jquery.min.js:2)
at n.fn.init.each (jquery.min.js:2)

Here's my current href line...

href: 'http://localhost:12345/Site/{{site_Id}}',

Works fine in both IE and Chrome when I omit the href.

running-coder added a commit that referenced this issue Sep 7, 2017

running-coder added a commit that referenced this issue Sep 7, 2017

@running-coder

This comment has been minimized.

Owner

running-coder commented Sep 7, 2017

There was a scope issue when using the href option with the refactored code for multiselect option coming in 2.10.0. Can't believe there was no tests that would have caught it... I've added one in case it ever occurs again. Thanks for reporting

@running-coder running-coder added this to the 2.10.0 milestone Sep 7, 2017

@Decklock

This comment has been minimized.

Decklock commented Sep 7, 2017

Clean run with this version. Works for me in Chrome, IE, and Firefox. Thanks!!

running-coder added a commit that referenced this issue Sep 7, 2017

Version 2.10.0
Features
- #138 Add `multiselect` option
- #365 Add support for `disabled` items

Fixes
- #353 `group.template` as a string
- #367 isContentEditable always true on IE11

running-coder added a commit that referenced this issue Sep 7, 2017

Version 2.10.0
Features
- #138 Add `multiselect` option
- #365 Add support for `disabled` items

Fixes
- #353 `group.template` as a string
- #367 isContentEditable always true on IE11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment