""" Simple test to debug the handleClick duplication issue """ import badgui as bg with bg.page("/", "DebugTest", "Debug Test"): bg.label("Debug Test").classes("text-h3") # Just one button with one handler button = bg.button("Test Button") button.on_click('handleClick') # Simple script with just one function bg.script(""" const handleClick = () => { console.log('Button clicked!'); }; onMounted(() => { console.log('Debug test loaded'); }); """) if __name__ == "__main__": bg.dev(port=3034)