mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-08 03: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
186180800f
commit
f6444b2570
@ -5,6 +5,7 @@ import { Searchable } from '../../../common/protocol/searchable';
|
||||
import { Installable } from '../../../common/protocol/installable';
|
||||
import { InstallationProgressDialog } from '../installation-progress-dialog';
|
||||
import { SearchBar } from './search-bar';
|
||||
import { ListWidget } from './list-widget';
|
||||
import { ComponentList } from './component-list';
|
||||
import { ListItemRenderer } from './list-item-renderer';
|
||||
|
||||
@ -25,6 +26,7 @@ export class FilterableListContainer<T> extends React.Component<FilterableListCo
|
||||
}
|
||||
|
||||
render(): React.ReactNode {
|
||||
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'}>
|
||||
{this.renderSearchFilter()}
|
||||
{this.renderSearchBar()}
|
||||
@ -93,6 +95,7 @@ export class FilterableListContainer<T> extends React.Component<FilterableListCo
|
||||
export namespace FilterableListContainer {
|
||||
|
||||
export interface Props<T> {
|
||||
readonly container: ListWidget<T>;
|
||||
readonly installable: Installable<T>;
|
||||
readonly searchable: Searchable<T>;
|
||||
readonly itemLabel: (item: T) => string;
|
||||
|
@ -61,6 +61,7 @@ export abstract class ListWidget<T> extends ReactWidget {
|
||||
|
||||
render(): React.ReactNode {
|
||||
return <FilterableListContainer<T>
|
||||
container={this}
|
||||
resolveContainer={this.deferredContainer.resolve}
|
||||
resolveFocus={this.onFocusResolved}
|
||||
searchable={this.options.searchable}
|
||||
|
Loading…
x
Reference in New Issue
Block a user