mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-13 10:53:15 +00:00
Merge pull request #13597 from overleaf/ae-request-measure-view
[visual] Call view.requestMeasure in updateDOM if height could change GitOrigin-RevId: eac77962d3edffd3ce3220c7948373bc38e6d727
This commit is contained in:
parent
a716a500c5
commit
1d33231392
6 changed files with 14 additions and 8 deletions
|
@ -202,8 +202,9 @@ class TopPaddingWidget extends WidgetType {
|
|||
return this.height === widget.height
|
||||
}
|
||||
|
||||
updateDOM(element: HTMLElement): boolean {
|
||||
updateDOM(element: HTMLElement, view: EditorView): boolean {
|
||||
element.style.height = this.height + 'px'
|
||||
view.requestMeasure()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ export class EditableGraphicsWidget extends GraphicsWidget {
|
|||
return true
|
||||
}
|
||||
this.renderGraphic(element, view)
|
||||
view.requestMeasure()
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ export class EditableInlineGraphicsWidget extends EditableGraphicsWidget {
|
|||
// We need to make sure these are updated, as `renderGraphic` in the base
|
||||
// class will update them on the inner element.
|
||||
this.updateElementData(element)
|
||||
view.requestMeasure()
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
|
@ -55,6 +55,7 @@ export class GraphicsWidget extends WidgetType {
|
|||
return true
|
||||
}
|
||||
this.renderGraphic(element, view)
|
||||
view.requestMeasure()
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
|
@ -38,12 +38,13 @@ export class MakeTitleWidget extends WidgetType {
|
|||
])
|
||||
}
|
||||
|
||||
// TODO: needs view
|
||||
// updateDOM(element: HTMLElement): boolean {
|
||||
// this.destroyed = false
|
||||
// this.buildContent(view, element)
|
||||
// return true
|
||||
// }
|
||||
updateDOM(element: HTMLElement, view: EditorView): boolean {
|
||||
this.destroyed = false
|
||||
element.textContent = ''
|
||||
this.buildContent(view, element)
|
||||
view.requestMeasure()
|
||||
return true
|
||||
}
|
||||
|
||||
ignoreEvent(event: Event) {
|
||||
return event.type !== 'mouseup'
|
||||
|
|
|
@ -29,11 +29,12 @@ export class MathWidget extends WidgetType {
|
|||
return widget.math === this.math && widget.displayMode === this.displayMode
|
||||
}
|
||||
|
||||
updateDOM(element: HTMLElement) {
|
||||
updateDOM(element: HTMLElement, view: EditorView) {
|
||||
this.destroyed = false
|
||||
this.renderMath(element).catch(() => {
|
||||
element.classList.add('ol-cm-math-error')
|
||||
})
|
||||
view.requestMeasure()
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue