Hello,
We are upgrading to version 2.3.17 from 2.1.56 and we aren’t sure how to override show, hide and valueFunction when we are making a class that inherits from HTMLElement.
This is what we do in version 2.1.56
export default class AnnotationHTMLInfo extends HTMLInfo {
constructor() {
super();
this.mainElement = null;
}
show = (textBlock: GraphObject, diagram: Diagram, tool: Tool) => {
if (!diagram || !diagram.div) return;
if (!isTextBlock(textBlock)) return;
textBlock.panel.part.findObject('nodeAnnotationPanel').opacity = 0;
propagateEvent(
diagram.div.id,
new AnnotationTextEditorOpenedEvent(textBlock, diagram.div, textBlock.part.data as ToolNodeData),
);
tool.doCancel();
};
hide = () => {};
valueFunction = () => '';
}
}
show and hide are properties by default, so its a bit weird to override them, since they should be set by instances of the class, rather than the class definition.
It may be possible to override them regardless, but you might have to use the get/set syntax to do so, instead of setting them to a function, as if they were methods