(core) Null or undefined value on the Integer / Numeric cell

Summary: Text editor for Integer and Numeric column was showing null or undefined when the underlying value was null.

Test Plan: Browser test

Reviewers: dsagal

Reviewed By: dsagal

Differential Revision: https://phab.getgrist.com/D2817
pull/23/head
Jarosław Sadziński 3 years ago
parent 15723d1300
commit 2c93eafa44

@ -33,7 +33,7 @@ export class NTextEditor extends NewBaseEditor {
this._contentSizer = dom('div.celleditor_content_measure'),
this.textInput = dom('textarea', dom.cls('celleditor_text_editor'),
dom.style('text-align', this._alignment),
dom.prop('value', undefDefault(options.editValue, String(options.cellValue))),
dom.prop('value', undefDefault(options.editValue, String(options.cellValue ?? ""))),
this.commandGroup.attach(),
// Resize the textbox whenever user types in it.
dom.on('input', () => this.resizeInput())

@ -39,7 +39,7 @@ function TextEditor(options) {
this.textInput = dom('textarea.celleditor_text_editor',
kd.attr('placeholder', options.placeholder || ''),
kd.style('text-align', this._alignment),
kd.value(gutil.undefDefault(options.editValue, String(options.cellValue))),
kd.value(gutil.undefDefault(options.editValue, String(options.cellValue == null ? "" : options.cellValue))),
this.commandGroup.attach(),
// Resize the textbox whenever user types in it.

@ -1422,6 +1422,20 @@ export function hexToRgb(hex: string) {
return `rgba(${r}, ${g}, ${b}, 1)`;
}
/**
* Adds new column to the table.
* @param name Name of the column
*/
export async function addColumn(name: string) {
await scrollIntoView(await driver.find('.active_section .mod-add-column'));
await driver.find('.active_section .mod-add-column').click();
await waitForServer();
await waitAppFocus(false);
await driver.sendKeys(name);
await driver.sendKeys(Key.ENTER);
await waitForServer();
}
} // end of namespace gristUtils

Loading…
Cancel
Save