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

Issues with caret and didUpdateAttrs #1

Open
pcambra opened this issue Mar 30, 2017 · 1 comment
Open

Issues with caret and didUpdateAttrs #1

pcambra opened this issue Mar 30, 2017 · 1 comment

Comments

@pcambra
Copy link

pcambra commented Mar 30, 2017

The didUpdateAttrs method does this:

const optionsUpdated = this.get('optionNames')
  .some(optionName => this._isAttrChanged(attrs, optionName));
const htmlUpdated = Ember.get(attrs, 'newAttrs.html.value') !== this.$().trumbowyg('html');
const disabledUpdated = this._isAttrChanged(attrs, 'disabled');
const placeholderUpdated = this._isAttrChanged(attrs, 'placeholder');
if (optionsUpdated || placeholderUpdated) {
  this._destroyTrumbowyg();
  this._renderTrumbowyg();
}
if (htmlUpdated) {
  this.$().trumbowyg('html', this.get('html'));
}

However, if the html property is not empty (i.e an edit form), when enter is pressed, the caret returns to the beginning of the text and stays there (causing the editor to write backwards as a side effect).

I am not sure why this part is needed as the editor seems to be working fine otherwise

@blufish
Copy link

blufish commented Apr 21, 2018

See here: https://www.emberjs.com/deprecations/v2.x/#toc_arguments-in-component-lifecycle-hooks

I have a pull request in to resolve this.

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

2 participants