https://linen.dev logo
Join Discord
Powered by
# haxe-ui
  • a

    ambitious-knife-25690

    02/28/2023, 9:30 PM
    adding removeComponent made no difference
  • b

    bright-gpu-74537

    02/28/2023, 9:30 PM
    to dropdown?
  • a

    ambitious-knife-25690

    02/28/2023, 9:31 PM
    can't close the dropdown
  • b

    bright-gpu-74537

    02/28/2023, 9:31 PM
    can i see your impl?
  • a

    ambitious-knife-25690

    02/28/2023, 9:31 PM
    Copy code
    hx
        public override function addComponent(component:haxe.ui.core.Component):haxe.ui.core.Component {
            @:privateAccess component.recursiveReady();
            var c = super.addComponent(component);
            resizeComponent(c);
            App.app.scenes.main.add(c.visual);
            return c;
        }
        
        public override function removeComponent(component:Component, dispose:Bool = true):Component {
            rootComponents.remove(component);
            App.app.scenes.main.remove(component.visual);
            return component;
        }
  • a

    ambitious-knife-25690

    02/28/2023, 9:32 PM
    (screenimpl)
  • a

    ambitious-knife-25690

    02/28/2023, 9:32 PM
    Copy code
    hx
        private override function handleAddComponent(child:Component):Component {
            // trace('${pad(this.id)}: add component -> ${child.id}');
            child.visual.depth = getDepthIndex(cast this) + 1;
            trace(child.visual.depth);
            trace(Type.getClassName(Type.getClass(this)));
            trace(Type.getClassName(Type.getClass(child)));
            this.visual.add(child.visual);
            //this.visual.autoChildrenDepth();
            if (this.parentComponent == null && !this.addedRoot) {
                App.app.scenes.main.add(this.visual);
                this.addedRoot = true;
            }
    
            return child;
        }
    
        private override function handleAddComponentAt(child:Component, index:Int):Component {
            // trace('${pad(this.id)}: add component at index -> ${child.id}, ${index}');
            if (child.visual.children != null) {
                child.visual.depth = index;
            }
    
            this.visual.add(child.visual);
            return child;
        }
    
        private override function handleRemoveComponent(child:Component, dispose:Bool = true):Component {
            // trace('${pad(this.id)}: remove component -> ${child.id}');
            this.visual.remove(child.visual);
            if (dispose == true) {
                child.visual.dispose();
            }
            return child;
        }
    
        private override function handleRemoveComponentAt(index:Int, dispose:Bool = true):Component {
            // trace('${pad(this.id)}: remove component at index -> ${index}');
            var child = this.visual.children[index];
            if (child != null) {
                visual.remove(child);
    
                if (dispose == true) {
                    child.dispose();
                }
            }
            return null;
        }
  • a

    ambitious-knife-25690

    02/28/2023, 9:32 PM
    compimpl
  • b

    bright-gpu-74537

    02/28/2023, 9:33 PM
    is it calling your screen.removecomponent when you close the dd?
  • a

    ambitious-knife-25690

    02/28/2023, 9:34 PM
    it does!
  • b

    bright-gpu-74537

    02/28/2023, 9:34 PM
    maybe you have to recusively remove visuals? Dunno enough about ceramic
  • b

    bright-gpu-74537

    02/28/2023, 9:34 PM
    but clearly
    App.app.scenes.main.remove(component.visual);
    isnt doing what you think / want
  • b

    bright-gpu-74537

    02/28/2023, 9:35 PM
    also, just an fyi, dont forget to honour dispose (or not) in screen removecomponent... the dropdown for example will NOT dispose of its dropdown list
  • b

    bright-gpu-74537

    02/28/2023, 9:36 PM
    but thats not the issue here, the issue is remove isnt removing the visual for whatever reason
  • a

    ambitious-knife-25690

    02/28/2023, 9:36 PM
    yeah, i noticed that when i pasted the compimpl and added it
  • a

    ambitious-knife-25690

    02/28/2023, 9:37 PM
    lemme test turning it invisible 😄
  • a

    ambitious-knife-25690

    02/28/2023, 9:37 PM
    okay yes, you are correct
  • a

    ambitious-knife-25690

    02/28/2023, 9:38 PM
    remove isn't doing what i expect 🤔
  • a

    ambitious-knife-25690

    02/28/2023, 9:38 PM
    changing
    visible = false
    makes the dd go away
  • a

    ambitious-knife-25690

    02/28/2023, 9:38 PM
    @billowy-waiter-28954 is this expected behaviour?
  • b

    bright-gpu-74537

    02/28/2023, 9:39 PM
    sure, thats fine, but you probably do wanna work out whats going on, likely indicative of other issues
  • a

    ambitious-knife-25690

    02/28/2023, 9:39 PM
    yes, cause if remove isn't halting rendering then the entire removecomponent impl in haxeui backend isn't correct atm
  • a

    ambitious-knife-25690

    02/28/2023, 9:40 PM
    i'm not sure where to go with this particular issue as well
  • a

    ambitious-knife-25690

    02/28/2023, 9:41 PM
    there doesn't appear to be an obvious substitute for remove
  • a

    ambitious-knife-25690

    02/28/2023, 9:42 PM
    i guess i could combo remove with visible as a temp solution for now
  • a

    ambitious-knife-25690

    02/28/2023, 9:45 PM
    this at least "looks" correct for now
  • a

    ambitious-knife-25690

    02/28/2023, 9:45 PM
    escape even works
  • b

    bright-gpu-74537

    02/28/2023, 9:56 PM
    does it also fix the listview thing? (you might need to do "hide the visual" in the componentimpl also - dunno)
  • a

    ambitious-knife-25690

    02/28/2023, 10:00 PM
    it looks like it does fix it with a caveat
  • a

    ambitious-knife-25690

    02/28/2023, 10:00 PM
    it collapses rather than scrolls 😄
1...155715581559...1687Latest