AllenFang / AllenFang/react-bootstrap-table

mode: radio with clickToSelectAndEditCell: true has wrong behaviour

未關閉
#1,615 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug in progress
主要語言
JavaScript
星號
2.2k
分支
761
PR 合併指標
30 天內沒有已合併 PR

描述

Hello,
I think we have a wrong behaviour with `clickToSelectAndEditCell: true` and `mode:radio`

**Situation 1:**
Any table with `cellEdit={ cellEditTableData }` `selectRow={ selectRow } ` and this const values:
```
const cellEditTableData = {
mode: 'dbclick'
};
```
```
const selectRow = {
mode: 'radio',
bgColor: function(row, isSelect) {
if (isSelect) {
return '#e6daac';
}
return null;
}
};
```
Now we have a table with radio buttons. When we click on the radio button we can select a row. If we click on the same radio button of the row, which is right now selected, nothing happens. The row is still selected, we cannot unselect the row.

**Situation 2:**
we have the same table again with `celledit `and with this changed const value for `selectRow`:
```
const selectRowTableTaenze = {
mode: 'radio',
clickToSelectAndEditCell: true, //the difference to the first situation.
bgColor: function(row, isSelect) {
if (isSelect) {
return '#e6daac';
}
return null;
}
};
```
What happens now. We can click on the row -> The row is selected. We click again on the same row, which is right now selected -> suddenly I can deselect the row! This shouldn't happen if I have choosen `mode: radio`. I understand this behaviour when we have `mode:checkbox`, but on `mode:radio` it is not correct.

Thank you

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。