neo.mjs 8.6.1 → 8.6.2
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/apps/ServiceWorker.mjs
CHANGED
package/package.json
CHANGED
package/src/DefaultConfig.mjs
CHANGED
@@ -262,12 +262,12 @@ const DefaultConfig = {
|
|
262
262
|
useVdomWorker: true,
|
263
263
|
/**
|
264
264
|
* buildScripts/injectPackageVersion.mjs will update this value
|
265
|
-
* @default '8.6.
|
265
|
+
* @default '8.6.2'
|
266
266
|
* @memberOf! module:Neo
|
267
267
|
* @name config.version
|
268
268
|
* @type String
|
269
269
|
*/
|
270
|
-
version: '8.6.
|
270
|
+
version: '8.6.2'
|
271
271
|
};
|
272
272
|
|
273
273
|
Object.assign(DefaultConfig, {
|
@@ -410,7 +410,8 @@ class ComboBox extends Picker {
|
|
410
410
|
|
411
411
|
// List might not exist until the picker is created
|
412
412
|
let {list} = me,
|
413
|
-
{selectionModel} = list
|
413
|
+
{selectionModel} = list,
|
414
|
+
index = store.indexOf(record);
|
414
415
|
|
415
416
|
// On show, set the active item to be the current selected record or the first
|
416
417
|
if (record) {
|
@@ -420,12 +421,8 @@ class ComboBox extends Picker {
|
|
420
421
|
selectionModel.suspendEvents = false
|
421
422
|
}
|
422
423
|
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
list._focusIndex = -1; // silent update to ensure afterSetFocusIndex() always gets called
|
427
|
-
list.focusIndex = index > -1 ? index : 0
|
428
|
-
})
|
424
|
+
list._focusIndex = -1; // silent update to ensure afterSetFocusIndex() always gets called
|
425
|
+
list.focusIndex = index > -1 ? index : 0
|
429
426
|
}
|
430
427
|
// Filtered down to nothing - hide picker if it has been created.
|
431
428
|
else {
|
package/src/list/Base.mjs
CHANGED
@@ -256,13 +256,7 @@ class List extends Component {
|
|
256
256
|
* @protected
|
257
257
|
*/
|
258
258
|
afterSetFocusIndex(value, oldValue) {
|
259
|
-
|
260
|
-
|
261
|
-
if (Neo.isNumber(value)) {
|
262
|
-
Neo.main.addon.Navigator.navigateTo([me.getHeaderlessIndex(value), me.navigator])
|
263
|
-
} else if (value) {
|
264
|
-
Neo.main.addon.Navigator.navigateTo([me.getItemId(value[me.getKeyProperty()]), me.navigator])
|
265
|
-
}
|
259
|
+
value !== null && this.updateItemFocus(value)
|
266
260
|
}
|
267
261
|
|
268
262
|
/**
|
@@ -846,6 +840,32 @@ class List extends Component {
|
|
846
840
|
}
|
847
841
|
}
|
848
842
|
}
|
843
|
+
|
844
|
+
/**
|
845
|
+
*
|
846
|
+
* @param {Number|Object} value
|
847
|
+
* @returns {Promise<void>}
|
848
|
+
*/
|
849
|
+
async updateItemFocus(value) {
|
850
|
+
let me = this,
|
851
|
+
{navigateTo} = Neo.main.addon.Navigator;
|
852
|
+
|
853
|
+
if (me.mounted) {
|
854
|
+
if (Neo.isNumber(value)) {
|
855
|
+
navigateTo([me.getHeaderlessIndex(value), me.navigator])
|
856
|
+
} else if (value) {
|
857
|
+
navigateTo([me.getItemId(value[me.getKeyProperty()]), me.navigator])
|
858
|
+
}
|
859
|
+
} else {
|
860
|
+
me.on('mounted', () => {
|
861
|
+
// We could subscribe multiple times before getting mounted,
|
862
|
+
// so only trigger the callback for the last focusIndex
|
863
|
+
if (value === me.focusIndex) {
|
864
|
+
me.updateItemFocus(me.focusIndex)
|
865
|
+
}
|
866
|
+
}, me, {once: true})
|
867
|
+
}
|
868
|
+
}
|
849
869
|
}
|
850
870
|
|
851
871
|
export default Neo.setupClass(List);
|