Use pendingState instead of state in UI events; state has not been set yet