charmbracelet / bubbletea

A powerful little TUI framework 🏗

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Drag and drop

mtd0 opened this issue · comments

commented

How to enable this feature (drag and drop), seen on the official Bubbletea website.

https://www.charm.sh/libs/

https://stuff.charm.sh/carts/bubbletea.mp4

I think you can listen to mouse events in your update function to reposition and add components. https://pkg.go.dev/github.com/charmbracelet/bubbletea#MouseEvent

But it would be nice to showcase that in examples/.

commented

It would be great if there was an example with this function, so far I have not seen a similar function in another TUI package.

Hi everyone! It’s really nice to see some interest here. This is part of a fairly big feature that’s currently in development and scheduled for release in 2022. We’ll keep this thread updated as we get closer to a release.

Hi, any update to this @meowgorithm ?

Hi! My apologies for this dragging for so long. This definitely is still something we're working towards—albeit slowly as it's also part of a larger initiative.

In the meantime, I'd have a look at charmbracelet/lipgloss#102 as a viable workaround. We've seen users typically break out the functionality shown in the PR to a local function in their projects.

Nice to see a recent update on this. Any chance this kind of work, along with anything going on to support "z-index" display layouts could be published in the X repo so we'd have a chance to provide feedback, possible PRs, etc? The alternative is to keep banging along with personal attempts that may be completely out of alignment.