Closed kvndrsslr closed 3 years ago
It is the same issue as #18. It works exactly how I implemented that. When user types in a field that has restrictions, it activates the event disabling other properties and removing previous values. If the person would like to change its mind and would like to use other properties instead it simply writes in another field and values of old properties are removed and disabled. The problem regarding not saving the availability of properties is in the library itself. Each time this panel is drawn on canvas again from scratch it doesn't save styles state of it, it remembers only inserted values. There is no option for saving styles inside canvas in this library. And another problem is that there is no event for opening this panel for inserting properties in the library. The only event that I found is 'onPropertyChanged' (https://github.com/jagenjo/litegraph.js/wiki/Creating-custom-Nodes) and I used it. On panel there are only events for the input fields but not for opening or closing this panel. I don't see any other way how it can be implemented with this library so far. I would implement our own panel and there we could implement whatever we want. This library panel is too restricted. It doesn't support optional properties, adding new elements like radio buttons and so on.
I was not aware of this limitation. Thanks for explaining it. It would indeed be nice if you could develop a better panel. If I understand correctly, you would use pure HTML/CSS for that instead of drawing with the canvas API, right? How long would it take you to implement this?
I would create React JS component "Panel" since we are using this framework already. I guess, it would take around 1 week, maybe less. I also would need to disable the previous Panel somehow.
New panel added https://github.com/dice-group/deer/pull/27
When re-focussing a node the properties which get initially invalidated by
sh:xone
rendering are available again, see the example below.Before entering one of the properties: both available
After entering one property: the other becomes unavailable because of
sh:xone
After focussing another node and refoccusing this one, both properties are available again.
Please implement this in a way that it is remembered or recalculated on refocussing nodes.