Hello,
I’m using a foreign object inside my glsp graph, it contains a select element. My issue here is that I couldn’t retrieve data from event.target.value
or(options[index].value
). as it shows me Property 'value' does not exist on type 'EventTarget'
const htmlElement: any = (
<select
name={node.id}
id={node.id}
ref={node.id}
>
{options.length === 0 ? (
<option value="">empty</option>
) : (
options.map((option: string, index: number) => (
<option key={index} value={option}>
{option}
</option>
))
)}
</select>
);
setNamespace(htmlElement, "http://www.w3.org/1999/xhtml");
on(htmlElement, 'change', (event) =>
{
console.log('----------',node.id);
console.log('-----------',event.target.options);
this.handlClick(node.id , node.id )
})
I tried to do a casting:
const target = event.target as HTMLSelectElement
const selectedValue = target.value
console.log('--------------',selectedValue);
but it shows me this: root INFO -------------- [object Object]
Can you help me with this, thanks in advance