dream-num / univer

Univer is an open-source alternative to Google Sheets, Slides, and Docs
https://univer.ai
Apache License 2.0
5.65k stars 468 forks source link

Hold down ctrl to select multiple cells, then click to get cell information[Bug] #2568

Open LaFee-Helei opened 1 week ago

LaFee-Helei commented 1 week ago

在您提交此问题之前,您是否检查了以下内容?

受影响的包和版本

"@univerjs/core": "^0.1.15"

复现链接

https://univer.ai/playground?title=Vite

预期行为

const univerAPI = FUniver.newAPI(univer);
const activeWorkbook = univerAPI.getActiveWorkbook();
const activeSheet =activeWorkbook.getActiveSheet();
activeWorkbook.onSelectionChange((params)=>{
    console.log(params);
})

or

univerAPI.onCommandExecuted((command)=>{
    const { id, type, params } = command;
    if (id === 'sheet.operation.set-selections') {
        console.log(params);
    }
});

For example, I select two cells with ctrl, then hold down the ctrl key while clicking to get information about both cells

实际行为

Its selections add duplicate data with each operation image When a mouse click is performed, the same shee.Operation. set-selections command is triggered twice image

运行环境

Safari

系统信息

No response

univer-bot[bot] commented 1 week ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

Origin Title: Hold down ctrl to select multiple cells, then click to get cell information[Bug]

Title: Hold down ctrl to select multiple cells, then click to get cell information[Bug]


Before you submitted this question, did you check the following?

Affected packages and versions

"@univerjs/core": "^0.1.15"

Recurrence link

https://univer.ai/playground?title=Vite

Expected behavior

const univerAPI = FUniver.newAPI(univer);
const activeWorkbook = univerAPI.getActiveWorkbook();
const activeSheet =activeWorkbook.getActiveSheet();
activeWorkbook.onSelectionChange((params)=>{
    console.log(params);
})

or

univerAPI.onCommandExecuted((command)=>{
    const { id, type, params } = command;
    if (id === 'sheet.operation.set-selections') {
        console.log(params);
    }
});

For example, I select two cells with ctrl, then hold down the ctrl key while clicking to get information about both cells

Actual behavior

Its selections add duplicate data with each operation image When a mouse click is performed, the same shee.Operation. set-selections command is triggered twice image

Running environment

Safari

system message

No response

Dushusir commented 1 week ago

Repeated selection of a selection should require deselection instead of repeating it. This is not implemented yet, but compatibility with Excel will be considered in the future. @DR-Univer @lumixraku Please check it selection