mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-10 04:46:33 +00:00
Update the ListWidget
on list container render.
To recalculate the desired size of the scroll-bar thumb. arduino/arduino-pro-ide#101 Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
parent
fdda4a72d0
commit
7e6343e60e
@ -26,6 +26,12 @@ export class FilterableListContainer<T extends ArduinoComponent> extends React.C
|
|||||||
this.props.filterTextChangeEvent(this.handleFilterTextChange.bind(this));
|
this.props.filterTextChangeEvent(this.handleFilterTextChange.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentDidUpdate(): void {
|
||||||
|
// See: arduino/arduino-pro-ide#101
|
||||||
|
// Resets the top of the perfect scroll-bar's thumb.
|
||||||
|
this.props.container.updateScrollBar();
|
||||||
|
}
|
||||||
|
|
||||||
render(): React.ReactNode {
|
render(): React.ReactNode {
|
||||||
this.props.container.update(); // This will recalculate the desired dimension of the scroll-bar thumb. (See: arduino/arduino-pro-ide#101)
|
this.props.container.update(); // This will recalculate the desired dimension of the scroll-bar thumb. (See: arduino/arduino-pro-ide#101)
|
||||||
return <div className={'filterable-list-container'}>
|
return <div className={'filterable-list-container'}>
|
||||||
|
@ -76,6 +76,12 @@ export abstract class ListWidget<T extends ArduinoComponent> extends ReactWidget
|
|||||||
this.deferredContainer.promise.then(() => this.filterTextChangeEmitter.fire(filterText));
|
this.deferredContainer.promise.then(() => this.filterTextChangeEmitter.fire(filterText));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateScrollBar(): void {
|
||||||
|
if (this.scrollBar) {
|
||||||
|
this.scrollBar.update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export namespace ListWidget {
|
export namespace ListWidget {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user