mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
ResourcePicker: Fix selecting icons (#68419)
This commit is contained in:
parent
49a18bc8e2
commit
24037ddd59
@ -21,7 +21,7 @@ interface CellProps {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function Cell(props: CellProps) {
|
const MemoizedCell = memo(function Cell(props: CellProps) {
|
||||||
const { columnIndex, rowIndex, style, data } = props;
|
const { columnIndex, rowIndex, style, data } = props;
|
||||||
const { cards, columnCount, onChange, selected } = data;
|
const { cards, columnCount, onChange, selected } = data;
|
||||||
const singleColumnIndex = columnIndex + rowIndex * columnCount;
|
const singleColumnIndex = columnIndex + rowIndex * columnCount;
|
||||||
@ -47,7 +47,7 @@ function Cell(props: CellProps) {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}, areEqual);
|
||||||
|
|
||||||
const getStyles = stylesFactory((theme: GrafanaTheme2) => {
|
const getStyles = stylesFactory((theme: GrafanaTheme2) => {
|
||||||
return {
|
return {
|
||||||
@ -125,7 +125,7 @@ export const ResourceCards = (props: CardProps) => {
|
|||||||
itemData={{ cards, columnCount, onChange, selected: value }}
|
itemData={{ cards, columnCount, onChange, selected: value }}
|
||||||
className={styles.grid}
|
className={styles.grid}
|
||||||
>
|
>
|
||||||
{memo(Cell, areEqual)}
|
{MemoizedCell}
|
||||||
</Grid>
|
</Grid>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
|
Loading…
Reference in New Issue
Block a user