Skip to content

Commit de8b892

Browse files
committed
- call focus with preventScroll: true in render-selection to prevent scrolling from non-interaction update.
- bump version
1 parent c8a5e8a commit de8b892

File tree

8 files changed

+35
-97
lines changed

8 files changed

+35
-97
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Change Logs
22

3+
## v0.6.8
4+
5+
- call `focus` with `preventScroll: true` in render-selection to prevent scrolling from non-interaction update.
6+
7+
38
## v0.6.7
49

510
- skip cell copy/cut if we are editing in textarea to preserve content editing experience.

dist/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1370,7 +1370,9 @@
13701370
this.dom.caret.classList.toggle('show', !!sbox);
13711371
}
13721372
return setTimeout(function(){
1373-
return this$.dom.textarea.focus();
1373+
return this$.dom.textarea.focus({
1374+
preventScroll: true
1375+
});
13741376
}, 0);
13751377
},
13761378
data: function(it){

dist/index.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 18 additions & 91 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "@plotdb/sheet",
44
"license": "MIT",
55
"description": "spreadsheet",
6-
"version": "0.6.7",
6+
"version": "0.6.8",
77
"style": "dist/index.min.css",
88
"browser": "dist/index.min.js",
99
"main": "dist/index.min.js",

src/index.ls

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,9 @@ sheet.prototype = Object.create(Object.prototype) <<< do
690690
# - perhaps this is because we do render-selection in mousedown,
691691
# and click event send focus to clicked element. if this is the case,
692692
# we may need to prevent refocusing once textarea.focus is on going. TODO
693-
setTimeout (~> @dom.textarea.focus!), 0
693+
# - preventScroll: true is required to prevent scrolling
694+
# when we simply call data to update data without user interaction.
695+
setTimeout (~> @dom.textarea.focus preventScroll: true), 0
694696

695697
data: ->
696698
if !(it?) => return @_data

web/static/assets/lib/@plotdb/sheet/dev/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1370,7 +1370,9 @@
13701370
this.dom.caret.classList.toggle('show', !!sbox);
13711371
}
13721372
return setTimeout(function(){
1373-
return this$.dom.textarea.focus();
1373+
return this$.dom.textarea.focus({
1374+
preventScroll: true
1375+
});
13741376
}, 0);
13751377
},
13761378
data: function(it){

web/static/assets/lib/@plotdb/sheet/dev/index.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)