Skip to content

Autocomplete: Work around isContentEditable bug in Chrome #1673

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

Closed

Conversation

scottgonzalez
Copy link
Member

Fixes #14917

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @jzaefferer, @arschmitz and @treyhunner to be potential reviewers


return editable === "true" ? true :
editable === "false" ? false :
this._isContentEditable( element.parent() );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What value does editable have in this case? I think this would be easier to understand (assuming its null, replace as needed):

if ( editable === null ) {
  return this._isContentEditable( element.parent() );
}

return editable === "true";

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The third value is "inherit".

Your proposed logic would traverse before checking for an explicitly non-editable element. Traversing always has to be the last operation for inherited values.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fine to me:

if ( editable === "inherit" ) {
  return this._isContentEditable( element.parent() );
}

return editable === "true";

Assuming "true", "false" and "inherit" are the only values editable ever has, that should behave exactly like yours.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@scottgonzalez scottgonzalez deleted the autocomplete-contenteditable branch February 16, 2016 17:22
scottgonzalez added a commit that referenced this pull request Jun 9, 2016
Fixes #14917
Closes gh-1673

(cherry picked from commit cbceca7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants