Closing dialog with VKB active breaks canvas on returning page [answered]
While implementing text overlay tool to Paint application noticed following annoyance (#bug)
I have a page with canvas, then i push to a Dialog with TextField to enter some text. When i accept the Dialog it returns nicely to the page, but if the VKB is open, canvas gets roughly 10 onPaint events. If VKB is hidden while closing dialog there are no such onPaint events.
And when next draw/stroke/path (in this case context.fillText()
) is applied to the canvas, everything that was already drawn on canvas gets cleared. Sometimes random pixels appear too.
Maybe pageStack animation happening at same time as the VKB fadeout happens causes this (?)
As workaround, before allowing Dialog to be accepted, i set TextField.focus
to false, wait 500ms for VKB to disappear, then call Dialog.accept()
.
(Have not tried PageStackAction.Immediate
, or is it even possible to apply to Accept (or Cancel) dialog events?)
*VKB Virtual keyboard
Seems that on latest OS version, 500 ms is not always enough, canvas still gets cleared, increased to 1000 ms.
kimmoli ( 2015-05-26 14:16:25 +0200 )edit