This version includes many quality-of-life improvements making it easier to work with Compose HTML as well as a new Tabs component.
Frontend
- Add Kotlin implementations for
ResizeObserverandIntersectionObserverclasses.ResizeObserveris useful for when you want to detect size changes to an element. Traditionally, it was very hard to do this and required registering events at the page level.IntersectionObserveris useful for detecting when an element is rendered on screen. This can be useful for some scrolling tricks, like animating something when it first enters the user's view.
- Added more useful version of
window.fetchbecause the one that comes with the Kotlin/JS standard library is hard to use.- Also, added a new
window.httphelper class to help with the common http verbs, e.g.window.fetch(HttpMethod.GET, ...)vs.window.http.get(...)
- Also, added a new
- Added useful
Document.saveToDiskandDocument.loadFromDiskutility methods, which help you save / load binary data.- There are additional load methods for text and data URL variations. The former because it's common and the latter because it's very useful for image loading.
- Fixed an issue with
PageContextlosing route params / fragment information when you returned back to a previous page. - Cleaned up the
CSSPositionAPI and fixed some cases where it was busted.
Silk
- New
Tabscomponent!
- Added a new strategy for opening a popup based on a timer:
val timedStrat = remember { OpenClosePopupStrategy.timed(1000) } // Shows popup for 1 second Button(onClick = { tooltipStrat.showAndStartTimer(); copyDocumentToClipboard() }) { Text("Copy") } AdvancedTooltip(ElementTarget.PreviousSibling, "Copied!", openCloseStrategy = tooltipStrat)
- Fixed a bug with tooltips not showing up if one was requested by an element when the mouse was already over it (like the "Copied!" example in the previous bullet point)
- Fixed a bug with tooltips not getting repositioned if their size changed after being shown.