Commit b8a0ecd
committed
fix($compile): ensure that hidden input values are correct after history.back
Due to the nature of some browser's PageCache/BFCache, returning to an Angular
app sometimes causes `input[hidden]` elements to retain the last value
that was stored before the page was navigated away from previously.
This is particularly problematic if the input has an interpolated value.
E.g. `<input type="hidden" value="{{ 1 + 2 }}">` since when the browser
returns, instead of the original interpolation template, the HTML contains
the previous value `<input type="hidden" value="3">`.
This commit instructs the browser not to attempt to reinstate the previous
value when navigating back in history by setting `autocomplete="off"` on
the hidden input element element.1 parent ed44dd0 commit b8a0ecd
1 file changed
+11
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1030 | 1030 | | |
1031 | 1031 | | |
1032 | 1032 | | |
| 1033 | + | |
1033 | 1034 | | |
1034 | 1035 | | |
1035 | 1036 | | |
1036 | 1037 | | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
1037 | 1041 | | |
1038 | 1042 | | |
1039 | | - | |
| 1043 | + | |
1040 | 1044 | | |
1041 | 1045 | | |
1042 | 1046 | | |
| |||
1076 | 1080 | | |
1077 | 1081 | | |
1078 | 1082 | | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
1079 | 1089 | | |
1080 | 1090 | | |
1081 | 1091 | | |
| |||
0 commit comments