You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using a wrapper library for PopperJS called cytoscape-popper. PopperJS uses TippyJS to show tips given an element.
My specific use case is that I'm porting this cytoscape-popper library as a widget to Jupyter notebook and to do that I need to use Typescript.
Now, I'm having some issues when I try to use non-basic types like lists and dictionaries on the configuration of my tips. If I try to use options like the following on my tip:
if (node.data().name){
let tip = Tippy(dummyDomEle, {
trigger: 'manual',
lazy: false,
//bools or strings won't cause any problem
arrow: true,
theme: 'material',
placement: 'bottom',
//it only crashes if I use types like lists, etc
offset: [0, 10],
content: () => {
let content = document.createElement('div');
content.innerHTML = node.data().name;
return content;
},
onCreate: instance => { instance!.popperInstance!.reference = ref; } // needed for `ref` positioning
});
tip.show();
}
I'll run to the following error:
TS2345: Argument of type '{ trigger: string; lazy: false; arrow: true; theme: string; placement: "bottom"; offset: number[]; content: () => HTMLDivElement; onCreate: (instance: Instance<Props>) => void; }' is not assignable to parameter of type 'Partial<Props>'.
Types of property 'offset' are incompatible.
Type 'number[]' is not assignable to type 'string | number | undefined'.
Type 'number[]' is not assignable to type 'number'.
I've opened a similar issue to this one on the popper-cytoscape page and in the opinion of the maintainer this is likely a TippyJS problem with Typescript.
Do you have any known issues with Typescript, any idea of what might be happening here?
Bug description
I'm using a wrapper library for PopperJS called cytoscape-popper. PopperJS uses TippyJS to show tips given an element.
My specific use case is that I'm porting this cytoscape-popper library as a widget to Jupyter notebook and to do that I need to use Typescript.
Now, I'm having some issues when I try to use non-basic types like lists and dictionaries on the configuration of my tips. If I try to use options like the following on my tip:
I'll run to the following error:
I've opened a similar issue to this one on the popper-cytoscape page and in the opinion of the maintainer this is likely a TippyJS problem with Typescript.
Do you have any known issues with Typescript, any idea of what might be happening here?
These are my relevant dependencies:
Reproduction
I can create a small reproducible example if you're interested in testing it yourself, as well explain the setup to run a Jupyter widget.
Thank you very much.
The text was updated successfully, but these errors were encountered: