From 578dea2ecd654996b01a2a1f6270183ba143c73b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Kov=C3=A1=C5=99?= Date: Thu, 16 May 2024 23:38:42 +0200 Subject: [PATCH] feat: formAssociated attribute --- src/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.js b/src/index.js index f82fbd5..049edc9 100644 --- a/src/index.js +++ b/src/index.js @@ -64,6 +64,10 @@ export default function register(Component, tagName, propNames, options) { Object.keys(Component.propTypes || {}); PreactElement.observedAttributes = propNames; + if (Component.formAssociated) { + PreactElement.formAssociated = true; + } + // Keep DOM properties and Preact props in sync propNames.forEach((name) => { Object.defineProperty(PreactElement.prototype, name, {