mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 10:23:33 +00:00
Add album list context menu
- Fix stale selected value when selecting single row with right click
This commit is contained in:
parent
9836d548a6
commit
131e3b3c65
3 changed files with 92 additions and 44 deletions
|
|
@ -160,12 +160,13 @@ export const SongListContent = ({ tableRef }: SongListContentProps) => {
|
|||
const clickEvent = e.event as MouseEvent;
|
||||
clickEvent.preventDefault();
|
||||
|
||||
const selectedRows = e.api.getSelectedRows();
|
||||
let selectedRows = e.api.getSelectedRows();
|
||||
const selectedUniqueIds = selectedRows.map((row) => row.uniqueId);
|
||||
|
||||
if (!selectedUniqueIds.includes(e.data.uniqueId)) {
|
||||
e.api.deselectAll();
|
||||
e.node.setSelected(true);
|
||||
selectedRows = [e.data];
|
||||
}
|
||||
|
||||
openContextMenu({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue