Skip to content

Commit

Permalink
Make TextEditor invisible until CSS is loaded (#5297)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Jul 21, 2023
1 parent 0c45a40 commit 9c0d993
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 6 additions & 1 deletion panel/models/quill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ export class QuillInputView extends HTMLBoxView {

render(): void {
super.render()
this.container = div({})
this.container = div({style: "visibility: hidden;"})
this.shadow_el.appendChild(this.container)
const theme = (this.model.mode === 'bubble') ? 'bubble' : 'snow'
this.watch_stylesheets()
this.quill = new (window as any).Quill(this.container, {
modules: {
toolbar: this.model.toolbar
Expand Down Expand Up @@ -77,6 +78,10 @@ export class QuillInputView extends HTMLBoxView {
});
}

style_redraw(): void {
this.container.style.visibility = 'visible';
}

after_layout(): void {
super.after_layout()
this._layout_toolbar()
Expand Down
3 changes: 1 addition & 2 deletions panel/models/tabulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,6 @@ export class DataTabulatorView extends HTMLBoxView {

let configuration = this.getConfiguration()
this.tabulator = new Tabulator(el, configuration)
console.log(el, this.tabulator)
this.watch_stylesheets()
this.init_callbacks()
}
Expand Down Expand Up @@ -618,7 +617,7 @@ export class DataTabulatorView extends HTMLBoxView {
})
}

_render_row(row: any, resize: bool = true): void {
_render_row(row: any, resize: boolean = true): void {
const index = row._row?.data._index
if (!this.model.expanded.includes(index) || !this.model.children.has(index))
return
Expand Down

0 comments on commit 9c0d993

Please sign in to comment.