Skip to content

Commit e6d3a31

Browse files
committed
fix(editors): longText Editor (textarea) was scrolling to page bottom
- 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
1 parent 8106b09 commit e6d3a31

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/app/modules/angular-slickgrid/editors/longTextEditor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ export class LongTextEditor implements Editor {
157157
editorFooterElm.appendChild(saveBtnElm);
158158
this._bindEventService.bind(cancelBtnElm, 'click', this.cancel.bind(this) as EventListener);
159159
this._bindEventService.bind(saveBtnElm, 'click', this.save.bind(this) as EventListener);
160+
this.position(this.args?.position);
160161
this._textareaElm.focus();
161162
this._textareaElm.select();
162-
this.position(this.args?.position);
163163
this._wrapperElm.appendChild(editorFooterElm);
164164

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

0 commit comments

Comments
 (0)