@dolphinweex/weex-vue-render 0.2.107 → 0.2.109
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/dist/index.common.js +23 -3
- package/package.json +1 -1
package/dist/index.common.js
CHANGED
|
@@ -5276,14 +5276,27 @@ var inputCommon = {
|
|
|
5276
5276
|
},
|
|
5277
5277
|
|
|
5278
5278
|
methods: {
|
|
5279
|
+
/**
|
|
5280
|
+
* 将当前输入框滚动到可视区域中间
|
|
5281
|
+
*/
|
|
5282
|
+
scrollIntoViewCenter: function scrollIntoViewCenter () {
|
|
5283
|
+
var el = this.$el;
|
|
5284
|
+
if (!el || typeof el.scrollIntoView !== 'function') { return }
|
|
5285
|
+
setTimeout(function () {
|
|
5286
|
+
el.scrollIntoView({ block: 'center', inline: 'nearest', behavior: 'smooth' });
|
|
5287
|
+
}, 50);
|
|
5288
|
+
},
|
|
5289
|
+
|
|
5279
5290
|
focus: function focus (autofocus) {
|
|
5291
|
+
var this$1 = this;
|
|
5280
5292
|
// 当是自动聚焦时才需要主动弹出键盘,否则会导致键盘弹出但是组件失去焦点
|
|
5281
5293
|
if (autofocus) {
|
|
5282
5294
|
this.$el && weex.requireModule('bridgeModule').commandInterface(JSON.stringify({ operation: 'showKeyboard'}))
|
|
5283
5295
|
}
|
|
5284
5296
|
//dom可能没有被获取到,延迟触发
|
|
5285
|
-
setTimeout(()
|
|
5286
|
-
this.$el && this.$el.focus();
|
|
5297
|
+
setTimeout(function () {
|
|
5298
|
+
this$1.$el && this$1.$el.focus();
|
|
5299
|
+
this$1.scrollIntoViewCenter();
|
|
5287
5300
|
}, 200);
|
|
5288
5301
|
},
|
|
5289
5302
|
blur: function blur () {
|
|
@@ -5321,6 +5334,13 @@ var inputCommon = {
|
|
|
5321
5334
|
|
|
5322
5335
|
// support enter key event
|
|
5323
5336
|
createKeyboardEvent: function createKeyboardEvent (events) {
|
|
5337
|
+
var this$1 = this;
|
|
5338
|
+
// 用户点击聚焦时,同样滚动到页面中间
|
|
5339
|
+
var originFocus = events.focus;
|
|
5340
|
+
events.focus = function (ev) {
|
|
5341
|
+
this$1.scrollIntoViewCenter();
|
|
5342
|
+
originFocus && originFocus.call(this, ev);
|
|
5343
|
+
};
|
|
5324
5344
|
var customKeyType = this.returnKeyType;
|
|
5325
5345
|
if (customKeyType) {
|
|
5326
5346
|
var keyboardEvents = {
|
|
@@ -8215,7 +8235,7 @@ var slideMixin = {
|
|
|
8215
8235
|
|
|
8216
8236
|
// get standard index
|
|
8217
8237
|
_normalizeIndex: function _normalizeIndex (index) {
|
|
8218
|
-
var newIndex = (index + this.frameCount) % this.frameCount;
|
|
8238
|
+
var newIndex = (Number(index) + this.frameCount) % this.frameCount;
|
|
8219
8239
|
return Math.min(Math.max(newIndex, 0), this.frameCount - 1)
|
|
8220
8240
|
},
|
|
8221
8241
|
|
package/package.json
CHANGED