Update buffer when onCellClick

This commit is contained in:
Hein 2025-12-01 10:39:28 +02:00
parent 1ce5c25098
commit 249c283819

View File

@ -461,7 +461,18 @@ const { Provider, useStore: useGridlerStore } = createSyncStore<GridlerStoreStat
onCellClicked: (cell: Item, event: CellClickedEventArgs) => {
const state = get();
const [col, row] = cell;
state.glideProps?.onCellClicked?.(cell, event);
if (state.glideProps?.onCellClicked) {
state.glideProps?.onCellClicked?.(cell, event);
} else {
if (state.values?.length) {
if (state.onChange) {
state.onChange(state.values);
} else {
state.setState('values', state.values);
}
}
}
state._events.dispatchEvent(
new CustomEvent('onCellClicked', {
detail: { cell, col, row, state },