Fix the keyboard dismissed caused error

Signed-off-by: Bao Haojun <baohaojun@gmail.com>