Skip to content

Commit

Permalink
fix(editors): longText Editor (textarea) was scrolling to page bottom
Browse files Browse the repository at this point in the history
- the previous commit to convert jQuery to vanilla JS brought a small issue that was only noticeable when defining a fixed grid height, when that was set and user clicked on the textarea editor it will scrolling to the bottom of the page. This happened because the textarea must be created on the body instead of within the grid and we do a re-positioning of the DOM element to the position of the cell, and the issue was because we focus/select the text content right after it was created (before re-positioning it) and so it was going to the bottom for that reason, we simply need to re-position it BEFORE focusing/selecting the text content
  • Loading branch information
ghiscoding committed Jun 11, 2021
1 parent 8106b09 commit e6d3a31
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ export class LongTextEditor implements Editor {
editorFooterElm.appendChild(saveBtnElm);
this._bindEventService.bind(cancelBtnElm, 'click', this.cancel.bind(this) as EventListener);
this._bindEventService.bind(saveBtnElm, 'click', this.save.bind(this) as EventListener);
this.position(this.args?.position);
this._textareaElm.focus();
this._textareaElm.select();
this.position(this.args?.position);
this._wrapperElm.appendChild(editorFooterElm);

this._bindEventService.bind(this._textareaElm, 'keydown', this.handleKeyDown.bind(this) as EventListener);
Expand Down

0 comments on commit e6d3a31

Please sign in to comment.