File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
src/platforms/web/runtime/modules Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -38,14 +38,11 @@ function updateDOMProps (oldVnode: VNodeWithData, vnode: VNodeWithData) {
3838 }
3939 }
4040
41- // #4521: if a click event triggers update before the change event is
42- // dispatched on a checkbox/radio input, the input's checked state will
43- // be reset and fail to trigger another update.
44- // The root cause here is that browsers may fire microtasks in between click/change.
45- // In Chrome / Firefox, click event fires before change, thus having this problem.
46- // In Safari / Edge, the order is opposite.
47- // Note: in Edge, if you click too fast, only the click event would fire twice.
48- if ( key === 'checked' && cur === oldProps [ key ] ) {
41+ // skip the update if old and new VDOM state is the same.
42+ // the only exception is `value` where the DOM value may be temporarily
43+ // out of sync with VDOM state due to focus, composition and modifiers.
44+ // This also covers #4521 by skipping the unnecesarry `checked` update.
45+ if ( key !== 'value' && cur === oldProps [ key ] ) {
4946 continue
5047 }
5148
You can’t perform that action at this time.
0 commit comments