Skip to content

Issues with caret and didUpdateAttrs #1

Description

@pcambra

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions