inputmethod: update state on new value not cached value
We want to update the inputpanel state on new value which is being set and not based on the cached value.
Fixes the keyboard going in wrong mode like pre-edit mode when closed and re-opened.
cherry-pick to 5.21
Edited by Bhushan Shah