Skip to content

v0.0.0-alpha.11

Pre-release
Pre-release

Choose a tag to compare

@lrstanley lrstanley released this 21 Nov 10:38
v0.0.0-alpha.11
287b841

Highlights

  • Pass an event on with on.Pass. A handler that has no use for an event returns on.Pass, as it would tea.Quit, and the event goes to the nearest node around it with a handler for it, and on outward until one takes it. It never passes out of a modal layer. Scroll, Mouse, Click, ClickAt, RightClick, RightClickAt, MiddleClick, DoubleClick, and Press support it.

    cell := bloom.Text(name).On(on.RightClick(func() tea.Cmd {
    	if !m.hasMenu(i) {
    		return on.Pass // the row's menu opens instead
    	}
    	return m.openMenu(i)
    }))
  • Scrolling chains outward. A viewport passes a wheel step on when it can't move that way: at its edge, or with all of its text in sight. A one-line input or an editor at its end inside a scrolling form now lets the form scroll. Selecting past the edge of a viewport at its end scrolls the page around it too.

  • Unstyled text wraps. Text without a style now wraps to its width, as styled text does, instead of running off the edge. Text.NoWrap keeps each line whole and cuts it off at the edge, for tables and ASCII art.

Breaking changes

  • on.Handler.Handle returns (tea.Cmd, bool), where false means the handler passed the event on.
  • Unstyled text that is wider than its node now wraps onto more rows. Add .NoWrap() to keep the old clipping.

Changelog

✨ New Features

📚 Documentation

🧹 Misc

1 change

📦 Dependency Updates

1 change

Full changelog: v0.0.0-alpha.10...v0.0.0-alpha.11

📦 Install

go get bloomfx.dev/bloom@v0.0.0-alpha.11

Docs: bloomfx.dev/bloom

💬 What to do next?