mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) Accept values entered into Reference columns showing RowIDs without waiting.
Summary: - Normally Reference columns can only be used for data entry once the target table has loaded. When it shows RowID, we shouldn't need to wait. - Also, fix pasting values between cells of a RowID-showing column. Test Plan: Added a test for entering data before data has loaded. Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D2902
This commit is contained in:
parent
d0905b6224
commit
11c944d794
@ -107,7 +107,7 @@ function makePasteHtml(tableData, selection, includeColHeaders) {
|
|||||||
let rawValue = col.rawGetter(rowId);
|
let rawValue = col.rawGetter(rowId);
|
||||||
let fmtValue = col.fmtGetter(rowId);
|
let fmtValue = col.fmtGetter(rowId);
|
||||||
let dataOptions = {};
|
let dataOptions = {};
|
||||||
if (rawValue != fmtValue) {
|
if (rawValue !== fmtValue) {
|
||||||
dataOptions['data-grist-raw-value'] = JSON.stringify(rawValue);
|
dataOptions['data-grist-raw-value'] = JSON.stringify(rawValue);
|
||||||
}
|
}
|
||||||
return dom('td', dataOptions, fmtValue);
|
return dom('td', dataOptions, fmtValue);
|
||||||
|
@ -128,7 +128,12 @@ export class ReferenceEditor extends NTextEditor {
|
|||||||
if (matches.length > 0) {
|
if (matches.length > 0) {
|
||||||
return matches[0].value;
|
return matches[0].value;
|
||||||
} else {
|
} else {
|
||||||
return this.textInput.value;
|
const value = this.textInput.value;
|
||||||
|
if (this._visibleCol === 'id') {
|
||||||
|
// If the value is a valid number (non-NaN), save as a numeric rowId; else as text.
|
||||||
|
return +value || value;
|
||||||
|
}
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user