Skip to content

Commit

Permalink
fix(vdom): don't update value property if it hasn't changed
Browse files Browse the repository at this point in the history
  • Loading branch information
glennsl authored and MartinKavik committed Jun 10, 2021
1 parent b59062b commit 6ec9874
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- Implemented `FromIterator<(impl Into<Cow<'a, str>>, impl Into<Cow<'a, str>>)>` for `Headers`.
- Derived `Eq` and `PartialEq` for `Header`.
- Added `Header::name()` and `Header::value()`.
- Fixed an issue in vdom where inputs with invalid contents being cleared on Firefox

## v0.8.0

Expand Down
5 changes: 5 additions & 0 deletions src/browser/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ fn set_html_input_element_value(
input: &web_sys::HtmlInputElement,
value: &str,
) -> Result<(), Cow<'static, str>> {
// Don't update if value hasn't changed
if value == input.value() {
return Ok(());
}

// In some cases we need to set selection manually because
// otherwise the cursor would jump at the end on some platforms.

Expand Down

0 comments on commit 6ec9874

Please sign in to comment.