(core) Polish "Click to insert $id" tooltip

Summary:
The tooltip also broke recently on Firefox after upgrading Ace. This
includes a fix for the regression.

Test Plan: Updated test.

Reviewers: jarek

Reviewed By: jarek

Subscribers: jarek, dsagal

Differential Revision: https://phab.getgrist.com/D3982
This commit is contained in:
George Gevoian
2023-08-04 01:01:29 -07:00
parent bb6926d2a0
commit 0f2b1f6a89
3 changed files with 163 additions and 12 deletions

View File

@@ -421,15 +421,13 @@ export class FormulaEditor extends NewBaseEditor {
const colId = col.origCol.peek().colId.peek();
const aceObj = this._aceEditor.getEditor();
// Rect only to columns in the same table.
if (col.tableId.peek() !== this.options.column.table.peek().tableId.peek()) {
// aceObj.focus();
// Fall back to default behavior if cursor didn't move to a column in the same table.
this.options.gristDoc.onSetCursorPos(row, col).catch(reportError);
return;
}
const aceObj = this._aceEditor.getEditor();
if (!aceObj.selection.isEmpty()) {
// If text selected, replace whole selection
aceObj.session.replace(aceObj.selection.getRange(), '$' + colId);