@tarojs/taro-h5 3.5.8 → 3.5.10

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.
@@ -49,6 +49,7 @@ export default class ActionSheet {
49
49
  };
50
50
  lastConfig: {};
51
51
  el: HTMLDivElement;
52
+ mask: HTMLDivElement;
52
53
  actionSheet: HTMLDivElement;
53
54
  menu: HTMLDivElement;
54
55
  cells: HTMLDivElement[];
@@ -65,8 +65,8 @@ export default class ActionSheet {
65
65
  this.el.style.opacity = '0';
66
66
  this.el.style.transition = 'opacity 0.2s linear';
67
67
  // mask
68
- const mask = document.createElement('div');
69
- mask.setAttribute('style', inlineStyle(maskStyle));
68
+ this.mask = document.createElement('div');
69
+ this.mask.setAttribute('style', inlineStyle(maskStyle));
70
70
  // actionSheet
71
71
  this.actionSheet = document.createElement('div');
72
72
  this.actionSheet.setAttribute('style', inlineStyle(actionSheetStyle));
@@ -96,14 +96,14 @@ export default class ActionSheet {
96
96
  this.cells.forEach(item => this.menu.appendChild(item));
97
97
  this.actionSheet.appendChild(this.menu);
98
98
  this.actionSheet.appendChild(this.cancel);
99
- this.el.appendChild(mask);
99
+ this.el.appendChild(this.mask);
100
100
  this.el.appendChild(this.actionSheet);
101
101
  // callbacks
102
102
  const cb = () => {
103
103
  this.hide();
104
104
  resolve('cancel');
105
105
  };
106
- mask.onclick = cb;
106
+ this.mask.onclick = cb;
107
107
  this.cancel.onclick = cb;
108
108
  // show immediately
109
109
  document.body.appendChild(this.el);
@@ -157,6 +157,13 @@ export default class ActionSheet {
157
157
  }
158
158
  this.cells.splice(itemListLen);
159
159
  }
160
+ // callbacks
161
+ const cb = () => {
162
+ this.hide();
163
+ resolve('cancel');
164
+ };
165
+ this.mask.onclick = cb;
166
+ this.cancel.onclick = cb;
160
167
  // show
161
168
  this.el.style.display = 'block';
162
169
  setTimeout(() => {
package/dist/index.cjs.js CHANGED
@@ -3744,8 +3744,8 @@ class ActionSheet {
3744
3744
  this.el.style.opacity = '0';
3745
3745
  this.el.style.transition = 'opacity 0.2s linear';
3746
3746
  // mask
3747
- const mask = document.createElement('div');
3748
- mask.setAttribute('style', inlineStyle(maskStyle));
3747
+ this.mask = document.createElement('div');
3748
+ this.mask.setAttribute('style', inlineStyle(maskStyle));
3749
3749
  // actionSheet
3750
3750
  this.actionSheet = document.createElement('div');
3751
3751
  this.actionSheet.setAttribute('style', inlineStyle(actionSheetStyle));
@@ -3775,14 +3775,14 @@ class ActionSheet {
3775
3775
  this.cells.forEach(item => this.menu.appendChild(item));
3776
3776
  this.actionSheet.appendChild(this.menu);
3777
3777
  this.actionSheet.appendChild(this.cancel);
3778
- this.el.appendChild(mask);
3778
+ this.el.appendChild(this.mask);
3779
3779
  this.el.appendChild(this.actionSheet);
3780
3780
  // callbacks
3781
3781
  const cb = () => {
3782
3782
  this.hide();
3783
3783
  resolve('cancel');
3784
3784
  };
3785
- mask.onclick = cb;
3785
+ this.mask.onclick = cb;
3786
3786
  this.cancel.onclick = cb;
3787
3787
  // show immediately
3788
3788
  document.body.appendChild(this.el);
@@ -3836,6 +3836,13 @@ class ActionSheet {
3836
3836
  }
3837
3837
  this.cells.splice(itemListLen);
3838
3838
  }
3839
+ // callbacks
3840
+ const cb = () => {
3841
+ this.hide();
3842
+ resolve('cancel');
3843
+ };
3844
+ this.mask.onclick = cb;
3845
+ this.cancel.onclick = cb;
3839
3846
  // show
3840
3847
  this.el.style.display = 'block';
3841
3848
  setTimeout(() => {