mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Avoid editing fields on toggle dbclick
Summary: This prevents a quirky UI behavior where double-clicking a toggle would cause the field to start being edited. Test Plan: Browser tests. Reviewers: jarek Reviewed By: jarek Differential Revision: https://phab.getgrist.com/D4093
This commit is contained in:
@@ -473,14 +473,15 @@ DetailView.prototype._duplicateRows = async function() {
|
||||
}
|
||||
|
||||
DetailView.prototype._canSingleClick = function(field) {
|
||||
// we can't simple click if :
|
||||
// we can't single click if :
|
||||
// - the field is a formula
|
||||
// - the field is toggle (switch or checkbox)
|
||||
if (
|
||||
field.column().isRealFormula() || field.column().hasTriggerFormula()
|
||||
|| (
|
||||
field.column().pureType() === "Bool"
|
||||
&& ["Switch", "CheckBox"].includes(field.column().visibleColFormatter().widgetOpts.widget)
|
||||
field.column().isRealFormula() ||
|
||||
field.column().hasTriggerFormula() ||
|
||||
(
|
||||
field.column().pureType() === "Bool" &&
|
||||
["Switch", "CheckBox"].includes(field.visibleColFormatter().widgetOpts.widget)
|
||||
)
|
||||
) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user