tim-janik / anklang

MIDI and Audio Synthesizer and Composer
https://anklang.testbit.eu/
Mozilla Public License 2.0
51 stars 3 forks source link

Insertion order doesn't work, every device is inserted at end #46

Closed swesterfeld closed 2 weeks ago

swesterfeld commented 4 months ago

To insert a new device we have this "+" button in the device panel. But no matter where I click, the device always gets inserted at the end.

I've debugged this a bit, and I see that if I print the sibling in ui/b/devicepanel.vue like this:

diff --git a/ui/b/devicepanel.vue b/ui/b/devicepanel.vue
index 33e9c99..9d89878 100644
--- a/ui/b/devicepanel.vue
+++ b/ui/b/devicepanel.vue
@@ -121,6 +121,7 @@ export default {
       if (this.chain_ && !uri.startsWith ('DevicePanel:')) // assuming b-treeselector.devicetypes
        {
          const sibling = this.menu_origin?.sibling;
+         console.log ("sibling is ", sibling);
          let newdev;
          if (sibling)
            newdev = this.chain_.insert_device (uri, sibling);

I always get

sibling is  undefined