From 6c37ac56b7ee8da3b5ab67a08609d4a3024a888d Mon Sep 17 00:00:00 2001 From: Maddy <12754347+MaddyDev@users.noreply.github.com> Date: Thu, 5 Nov 2020 14:19:11 -0800 Subject: [PATCH] fix delete behavior on text cells. (#13153) * remove default

text and add css instead * remove the top/bottom padding on preview markdown --- .../notebook/browser/cellViews/textCell.component.ts | 2 +- .../contrib/notebook/browser/cellViews/textCell.css | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/sql/workbench/contrib/notebook/browser/cellViews/textCell.component.ts b/src/sql/workbench/contrib/notebook/browser/cellViews/textCell.component.ts index 29ddc036e8..497dd9ee0b 100644 --- a/src/sql/workbench/contrib/notebook/browser/cellViews/textCell.component.ts +++ b/src/sql/workbench/contrib/notebook/browser/cellViews/textCell.component.ts @@ -225,7 +225,7 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges { this._content = localize('addContent', "Add content here..."); } } else { - this._content = this.cellModel.source[0] === '' ? '

 

' : this.cellModel.source; + this._content = this.cellModel.source; } this.markdownRenderer.setNotebookURI(this.cellModel.notebookModel.notebookUri); this.markdownResult = this.markdownRenderer.render({ diff --git a/src/sql/workbench/contrib/notebook/browser/cellViews/textCell.css b/src/sql/workbench/contrib/notebook/browser/cellViews/textCell.css index 2bf8772fcb..0e32d333cc 100644 --- a/src/sql/workbench/contrib/notebook/browser/cellViews/textCell.css +++ b/src/sql/workbench/contrib/notebook/browser/cellViews/textCell.css @@ -17,6 +17,8 @@ text-cell-component .notebook-preview { flex-direction: column; padding-left: 8px; padding-right: 8px; + padding-top: 14px; + padding-bottom: 14px; user-select: none; width: 100%; outline: none; @@ -29,7 +31,9 @@ text-cell-component .show-markdown .notebook-preview { border-left-width: 1px; border-style: solid; border-top-width: 0; - width: 50% + width: 50%; + padding-top: 0px; + padding-bottom: 0px; } .notebook-preview.actionselect { user-select: text;