This change ensures that the value sanitization algorithm is run and the text cursor is set to the correct position when the type attribute of an input is changed.