@meta2d/core 1.1.5 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meta2d/core",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "description": "@meta2d/core: Powerful, Beautiful, Simple, Open - Web-Based 2D At Its Best .",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -181,9 +181,16 @@ export class Canvas {
181
181
  this.externalElements.ondrop = this.ondrop;
182
182
  this.externalElements.oncontextmenu = (e) => e.preventDefault();
183
183
  this.store.options.interval = 50;
184
- this.externalElements.ontouchstart = this.ontouchstart;
185
- this.externalElements.ontouchmove = this.ontouchmove;
186
- this.externalElements.ontouchend = this.ontouchend;
184
+ if (this.store.options.parentTouch) {
185
+ this.parentElement.ontouchstart = this.ontouchstart;
186
+ this.parentElement.ontouchmove = this.ontouchmove;
187
+ this.parentElement.ontouchend = this.ontouchend;
188
+ }
189
+ else {
190
+ this.externalElements.ontouchstart = this.ontouchstart;
191
+ this.externalElements.ontouchmove = this.ontouchmove;
192
+ this.externalElements.ontouchend = this.ontouchend;
193
+ }
187
194
  this.externalElements.onmousedown = (e) => {
188
195
  if (this.isMobile) {
189
196
  return;
@@ -6959,11 +6966,12 @@ export class Canvas {
6959
6966
  }
6960
6967
  }
6961
6968
  };
6962
- this.inputDiv.onblur = () => {
6963
- setTimeout(() => {
6964
- this.hideInput();
6965
- }, 300);
6966
- };
6969
+ // 下拉 点击滚动条
6970
+ // this.inputDiv.onblur = ()=>{
6971
+ // setTimeout(()=> {
6972
+ // this.hideInput()
6973
+ // },300)
6974
+ // }
6967
6975
  this.inputDiv.oninput = (e) => {
6968
6976
  const pen = this.store.pens[this.inputDiv.dataset.penId];
6969
6977
  if (pen && pen.inputType === 'number') {
@@ -8172,9 +8180,16 @@ export class Canvas {
8172
8180
  this.externalElements.removeEventListener('gesturestart', this.onGesturestart);
8173
8181
  this.externalElements.ondragover = (e) => e.preventDefault();
8174
8182
  this.externalElements.ondrop = undefined;
8175
- this.externalElements.ontouchstart = undefined;
8176
- this.externalElements.ontouchmove = undefined;
8177
- this.externalElements.ontouchend = undefined;
8183
+ if (this.store.options.parentTouch) {
8184
+ this.parentElement.ontouchstart = undefined;
8185
+ this.parentElement.ontouchmove = undefined;
8186
+ this.parentElement.ontouchend = undefined;
8187
+ }
8188
+ else {
8189
+ this.externalElements.ontouchstart = undefined;
8190
+ this.externalElements.ontouchmove = undefined;
8191
+ this.externalElements.ontouchend = undefined;
8192
+ }
8178
8193
  this.externalElements.onmousedown = undefined;
8179
8194
  this.externalElements.onmousemove = undefined;
8180
8195
  this.externalElements.onmouseup = undefined;