-
Notifications
You must be signed in to change notification settings - Fork 39
Make dom nodes created from v
accessible in a widget
#361
Comments
v
accessible in a widgetv
accessible in a widget
v
accessible in a widgetv
accessible in a widget
v
accessible in a widgetv
accessible in a widget
I did some prototyping and came up with one possible solution: edhager@2d24075 It uses the render decorator mechanism in WidgetBase. |
I started updating WidgetBase with code based on what was done in the prototype. My progress is in https://github.com/edhager/widget-core/tree/widgetbase-node-lifecycle. I have not written any tests yet. At this point, all I know is my code compiles. |
I added some tests and fixed some bugs. Getting close. I am not sure how to write a test for the afterCreate calls. |
Not sure how relevant my approach is for your work, but when testing widget afterCreate calls, I pass in an object cast to |
I just added some update tests and there is a problem with my code. The way I am adding the afterCreate and afterUpdate callbacks in a render decorator is giving me this error:
I may have to rethink my approach. |
I fixed the problem with the way I was registering the afterCreate and afterUpdate callbacks. A vdom update now works. I think I have everything working now. https://github.com/edhager/widget-core/tree/widgetbase-node-lifecycle |
I think my code may still have an issue. I am storing existing afterCreate and afterUpdate callbacks in maps using properties.key as the key to the map. That is not good enough because I think keys can be reused in different child lists. |
I fixed the duplicate key issue. |
At the moment the only mechanism we have for accessing a dom node is via maquette's
afterCreate
andafterUpdate
methods which are perv
call which is a bit clunky. We perhaps should provide a a mechanism in WidgetBase that allows you to access all dom nodes in a widget bykey
, as well as a lifecycle function on WidgetBase where you know these will be available.The text was updated successfully, but these errors were encountered: