ValidationTextBox#pattern changes should update state

Fixes #17408.

(cherry picked from commit d658ea556f423dc9fe284f84a98319d1974f7b1f)