How do you handle tooltips in a multi-platform pro...
# compose-desktop
m
How do you handle tooltips in a multi-platform project? I have a project where I would like to show tooltips in the desktop variant but not in the Android variant. In order to show a tooltip I have to wrap the relevant content in a TooltipArea but this code then won’t compile for Android where TooltipAreas are not supported. I can work around this by writing my own wrapper via expect/actual but is that really necessary? Isn’t there a more elegant solution?
b
Write your own tooltip composablewrapper via expect/actuals that renders nothing on android?
m
Well, that’s exactly what I have done already. But why do I have to do that. Why isn’t such a no-op provided by default?
b
Because it would introduce significant differences between platforms in a cross-platform ui framework. Kinda beats the whole point if you ask me.
m
What’s the difference between just providing such a no-op for Android or forcing everyone to implement his own wrapper. I’d say this is just annoying but obviously it’s just me who thinks so 😭
b
🤷 to each its own
o
it's not different from any other platform-specific feature. Would be strange to have noop implementation for all platforms where feature is irrelevant, IMO.