@lightningjs/ui
Advanced tools
Comparing version 1.3.3 to 1.3.4
# Changelog | ||
## v1.3.4 | ||
- Fix initial scroll when scroll offset different than 0. | ||
- Fix progress value in ProgressStepper component. | ||
## v1.3.3 | ||
@@ -4,0 +8,0 @@ - CollectionWrapper now only fires onIndexChanged when the index has actually changed. |
{ | ||
"name": "@lightningjs/ui", | ||
"version": "1.3.3", | ||
"version": "1.3.4", | ||
"description": "Standard UI components for Lightning", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -60,4 +60,4 @@ /* | ||
_indexChanged(obj) { | ||
let {previousIndex:previous, index:target, dataLength:max, mainIndex, previousMainIndex, lines} = obj; | ||
if(!isNaN(previousMainIndex) && !isNaN(mainIndex) && !isNaN(lines)) { | ||
let { previousIndex: previous, index: target, dataLength: max, mainIndex, previousMainIndex, lines } = obj; | ||
if (!isNaN(previousMainIndex) && !isNaN(mainIndex) && !isNaN(lines)) { | ||
previous = previousMainIndex; | ||
@@ -67,4 +67,4 @@ target = mainIndex; | ||
} | ||
if(this._requestsEnabled && !this._requestingItems) { | ||
if(previous < target && target + this._requestThreshold >= max) { | ||
if (this._requestsEnabled && !this._requestingItems) { | ||
if (previous < target && target + this._requestThreshold >= max) { | ||
this._requestingItems = true; | ||
@@ -74,6 +74,6 @@ this.signal('onRequestItems', obj) | ||
const type = typeof response; | ||
if(Array.isArray(response) || type === 'object' || type === 'string' || type === 'number') { | ||
if (Array.isArray(response) || type === 'object' || type === 'string' || type === 'number') { | ||
this.add(response); | ||
} | ||
if(response === false) { | ||
if (response === false) { | ||
this.enableRequests = false; | ||
@@ -88,3 +88,6 @@ } | ||
this.scrollCollectionWrapper(obj); | ||
this.signal('onIndexChanged', obj); | ||
if (previous !== target) { | ||
this.signal('onIndexChanged', obj); | ||
} | ||
} | ||
@@ -95,11 +98,5 @@ | ||
const previousIndex = this._index; | ||
if(previousIndex !== targetIndex) { | ||
this._index = targetIndex; | ||
this._indexChanged({previousIndex, index: targetIndex, dataLength: this._items.length}); | ||
return true; | ||
} | ||
return false; | ||
this._index = targetIndex; | ||
this._indexChanged({ previousIndex, index: targetIndex, dataLength: this._items.length }); | ||
return previousIndex !== targetIndex; | ||
} | ||
@@ -106,0 +103,0 @@ |
@@ -53,3 +53,3 @@ /* | ||
if(this.active) { | ||
this.tag('ProgressBar').value = this._value; | ||
this.tag('ProgressBar').value = this._value / (this._max - this._min); | ||
this.tag('Value').text.text = this._value; | ||
@@ -56,0 +56,0 @@ } |
210225
3049