Hi everyone,
I'm trying to make some kind of bar graph using APL. Works like a charm when just trying to display the bars, but after trying to wrap each bar into a touch wrapper, it appears that the positioning or the height of either the touch wrapper or the frame inside the touch wrapper seems to have an unexpected behaviour.
The weird thing is that it appears fine of the APL editor, and and the Test simulator, but not on devices.
The code without the touch wrapper, which works fine:
... { "type": "Container", "width": "60vw", "maxWidth": "60vw", "data": "${payload.bargraph.data.VALUES}", "alignItems": "end", "direction": "row", "justifyContent": "spaceBetween", "items": [ { "height": "${payload.bargraph.data.VALUES[index]}%", "type": "Frame", "width": "5dp", "backgroundColor": "#66cbff" } ] } ...
And with the touch wrapper, which displays differently on devices compared to simulators:
... { "type": "Container", "width": "60vw", "maxWidth": "60vw", "data": "${payload.bargraph.data.VALUES}", "alignItems": "end", "direction": "row", "justifyContent": "spaceBetween", "items": [ { "type": "TouchWrapper", "onPress": [{ "type": "SendEvent", "arguments": ["${index}", "bargraph"] }], "height": "${payload.bargraph.data.VALUES[index]}%", "item": [{ "type": "Frame", "width": "5dp", "backgroundColor": "#66cbff", "height": "100%" }] } ] } ...
I found a workaround, which is to force the height of the container, but it's not really what I wanted, as the Container above that is using flexbox-grow to scale-up. I'm surprised about the fact that the TouchWrapper seems to have an odd behaviour.
Alex