43f69066af9a088c24fce961b71777df6e4b184a
Reproduction (any node using assetMenu — measurement, rotatingMachine, pumpingStation, monster, …): open node -> pick Vega supplier -> pick Pressure type -> model dropdown stays "Awaiting Type Selection" Root cause: two interacting bugs in the chained dropdown wiring. 1. populate() inside both wireEvents() and loadData() auto-dispatched a synthetic 'change' event whenever the value of the rebuilt <select> differed from before the rebuild. That meant rebuilding 'type' inside the supplier change handler could fire the *type* change handler mid-way through, populate the model dropdown, and then return — only for the supplier handler to continue and unconditionally call populate(elems.model, [], '', undefined, 'Awaiting Type Selection'), wiping the model dropdown back to empty. 2. loadData() ran the same auto-dispatch path, so on initial open of a saved node the synthetic change cascaded through wireEvents listeners AND loadData's own sequential populate calls double-populated each level. The visible state depended on which path won the race. Fix: convert the chain to an explicit downward cascade. - populate() no longer dispatches change events. It simply rebuilds the <select> with placeholder + options and assigns the requested value. - New cascadeFromSupplier / cascadeFromType / cascadeFromModel helpers read the *current DOM value* of each upstream <select>, look up the matching item in menuData, and rebuild the next level — then call the next cascade explicitly. Order is now deterministic and the parent handler can never wipe the child after the child was populated. - Each <select>'s native 'change' listener is just the corresponding cascade function. Same code path runs for user picks AND for initial load, so saved-node restore behaves identically to a fresh pick. - The cascades are exposed under window.EVOLV.nodes.<name>.assetMenu._cascade so loadData (or future sync code) can re-run them after async data arrives without duplicating logic. No new DOM dependencies, no test framework changes. Existing generalFunctions tests still 52/61 (same 9 pre-existing failures unrelated to this change). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
convert
Makes unit conversions
#need to make an index to fetch the helper functions properly without destroying all the links.
Description
Languages
JavaScript
100%