diff options
| author | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-10-09 17:06:59 -0400 |
|---|---|---|
| committer | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-10-09 17:06:59 -0400 |
| commit | 36735ff00a55ae587af5f69eef495533a1f35393 (patch) | |
| tree | 9df8f19bdc1fd9137d024afb32603f02562aa70e /src/client/views/collections/collectionSchema/SchemaCellField.tsx | |
| parent | 6ae5bd63d5355a03dba099a149532e7c6b1fd74a (diff) | |
| parent | 1b038112b37c02d81431bc7ff622b25bb42a0858 (diff) | |
Merge branch 'nathan-starter' of https://github.com/brown-dash/Dash-Web into nathan-starter
Diffstat (limited to 'src/client/views/collections/collectionSchema/SchemaCellField.tsx')
| -rw-r--r-- | src/client/views/collections/collectionSchema/SchemaCellField.tsx | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/client/views/collections/collectionSchema/SchemaCellField.tsx b/src/client/views/collections/collectionSchema/SchemaCellField.tsx index dab494c0e..5a64ecc62 100644 --- a/src/client/views/collections/collectionSchema/SchemaCellField.tsx +++ b/src/client/views/collections/collectionSchema/SchemaCellField.tsx @@ -27,6 +27,7 @@ export interface SchemaCellFieldProps { oneLine?: boolean; Document: Doc; fieldKey: string; + // eslint-disable-next-line no-use-before-define refSelectModeInfo: { enabled: boolean; currEditing: SchemaCellField | undefined }; highlightCells?: (text: string) => void; GetValue(): string | undefined; @@ -154,8 +155,8 @@ export class SchemaCellField extends ObservableReactComponent<SchemaCellFieldPro } } - matches.forEach((match: string) => { - chunkedText = chunkedText.replace(match, this.generateSpan(match, cells.get(match))); + matches.forEach(m => { + chunkedText = chunkedText.replace(m, this.generateSpan(m, cells.get(m))); }); return chunkedText; @@ -301,13 +302,14 @@ export class SchemaCellField extends ObservableReactComponent<SchemaCellFieldPro setTimeout(() => this.setupRefSelect(this.refSelectConditionMet), 0); break; case ' ': - e.stopPropagation(); - let cursorPos = 0; - if (this.cursorPosition !== null) cursorPos = this.cursorPosition + 1; - setTimeout(() => { - this.setContent(this._unrenderedContent); - setTimeout(() => this.setCursorPosition(cursorPos)); - }, 0); + { + e.stopPropagation(); + const cursorPos = this.cursorPosition !== null ? this.cursorPosition + 1 : 0; + setTimeout(() => { + this.setContent(this._unrenderedContent); + setTimeout(() => this.setCursorPosition(cursorPos)); + }, 0); + } break; case 'u': // for some reason 'u' otherwise exits the editor e.stopPropagation(); @@ -318,7 +320,6 @@ export class SchemaCellField extends ObservableReactComponent<SchemaCellFieldPro case 'Control': case ':': // prettier-ignore break; - // eslint-disable-next-line no-fallthrough default: break; } |
