Skip to content

Hydrate clears value from <textarea defaultValue='x' /> #5080

@braddunbar

Description

@braddunbar
  • Check if updating to the latest Preact version resolves the issue

Describe the bug

When using hydrate with <textarea defaultValue='x' />, the value is cleared instead of retained.

To Reproduce

<!doctype html>
<html>
<head>
<script type='module'>
  import { h, hydrate } from 'https://esm.sh/preact'

  function Test() {
    return h('textarea', { defaultValue: 'x' })
  }

  hydrate(h(Test), document.body)
</script>
</head>
<body><textarea>x</textarea></body>
</html>

Expected behavior

The textarea should retain the value (x), but it's cleared when the page loads.

Reproduced in latest Chrome, Firefox, and Safari on macOS and Safari on latest iOS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions