-
Notifications
You must be signed in to change notification settings - Fork 782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Combination of Edit cell and Select row #276
Comments
Hi, This is point 2 of my issue
If you follow my explanation you'll understand why this happens. Let me know about point 1 if you want this tiny PR. Thanks BTW I am @dana2208 not dana :) |
@dana2208, sorry, I found your explanation, so tired, a busy year. Anyway, I'll check this problem at first and discuss with you, thanks :) |
@dana2208, I thinks I've solve this issues, but if you give |
Released on v1.5.2 :) |
Hello,
I found 2 implementations that feel not right when combining the edit cell and the select row feature.
Here is the way I combine them:
So what I expect is:
And here are the 2 actual behaviors:
This change is very simple and is to be implemented in
handleEditCell(rowIndex, columnIndex)
ofTableBody.js
.Instead of:
this.handleSelectRow(rowIndex+1, !selected);
Write:
if (!selected) {
this.handleSelectRow(rowIndex+1, true);
}
I can make a PR if you want.
BootstrapTable.js
that is called after component updated and that is run ifcellEdit
is defined on the table:if (this.props.cellEdit.mode !== Const.CELL_EDIT_NONE)
this.props.selectRow.clickToSelect = false;
Since
clickToSelect
is overriden with valuefalse
then in functionrowClick(e)
ofTableRow.js
the functionthis.props.onSelectRow(e.currentTarget.rowIndex, !this.props.isSelected)
is not called.However selection occurs when double-clicking because in
TableColumn.js
the functionhandleCellEdit(e)
is called which bubbles up tohandleEditCell(rowIndex, columnIndex)
of theTableBody.js
which calls the functionthis.handleSelectRow(rowIndex+1, true);
because propertyclickToSelectAndEditCell
istrue
.So all this cycle does not take into account that my selection was after one click and not after double-clicking.
I didn't try to think of a solution for this wrong behavior. If after my explanation you already know how to fix this then I will be glad, elsewhere I can try to think on a solution and make a PR. What do you say?
Thanks
The text was updated successfully, but these errors were encountered: