There is currently no way for Compose Web to inter...
# compose-web
a
There is currently no way for Compose Web to interop with the platform it is running on in terms of UI. It would be fantastic to be able to use native stuff like in other platforms (android, desktop + ios) from inside compose. ie using native HTML text inputs and have nice accessiblity support, or using HTML libraries. If you think the same, here is the feature request on YouTrack so you can join the convo or +1 it
Its seems you can’t have it both ways; Either everything is HTML, or everthing is Canvas.
a
you are describing how things are done right now. yes it is not currently possible that's why im openning a feature request, so that if people can comment on this if they want such functionality
a
There is a difference between a want and a can. Compose Web Canvas is just Skia. There is no knowledge of anything web related or the platform it is running on. If you want rich HTML components you should use Compose HTML.
☝🏼 1
I don't doubt it isn't possible in a very convoluted way, but it'll always mean that you add very platform dependent components for a framework that is supposed to be as multiplatform as possible. One could argue: why not add Compose Canvas components to Compose HTML?
f
Maybe we should check if Flutter can do it 🤔 don't they use Skia too?
a
Seems like it either way, all other platforms on compose does it, so why not on web?
a
@Alex Styl Because it isn't the highest priority? Or maybe it is hard to implement? The use-case might be pretty niche. I for one would not want HTML element in a canvas app unless it is the last possible solution.
Be aware, the Flutter implementation renders HTML Elements over it (obviously). So positioning, focus, resizing are a complete hassle. Since HTML Canvas natively doesn't support HTML Elements, this is also not something Compose will support. It'll always be some sort of overlay of two different technologies. If you want full rich HTML experience, go with Compose HTML. Flutter had something similar but abandoned it.
r
You can interop but you have to manually make sure to scale and translate yourself. Wonderous compose has an example of that. Like Arjan above said, it's far from perfect though.
a
@Rok Oblak just had a look. it looks exactly what I had in mind with this feature request (app linkinterop code for reference - MapView code)
👍 2
HTML rendered in the compose app
a
It is not rendered in… it is rendered on top. Big difference. If it is rendered in, you’ve gained nothing. The usability will be the same as with canvas
f
I see, so it’s possible, but it’s not officially supported (yet).
🎯 1
a
The 'HTML in Compose Web' ticket just got changed from Submitted to Open. Nice
👍 2