accessible-autocomplete icon indicating copy to clipboard operation
accessible-autocomplete copied to clipboard

Add props for setting form attribute on the input element

Open inulty-dfe opened this issue 1 month ago • 1 comments

Context

Form inputs accept a form attribute which allows you to place an input tag outside the block of a form tag and have that input value submitted with the form.

Reference

https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#form

The form attribute lets you place an input anywhere in the document but have it included with a form elsewhere in the document.

Approach

I tried to set the form attribute directly but it wasn't being rendered. Maybe someone can suggest why and I can avoid using the ref unnecessarily.

This is a known issue with Preact (and React). The form attribute is treated specially because HTMLInputElement.form is a read-only property that can't be set directly - it's automatically determined by the browser based on the input's parent form element.

inulty-dfe avatar Nov 14 '25 17:11 inulty-dfe

Deploy Preview for accessible-autocomplete ready!

Name Link
Latest commit 061dc8da2a82155d2cc53efe66d9a6e2feeef794
Latest deploy log https://app.netlify.com/projects/accessible-autocomplete/deploys/691c3f3bad4ff30008381ef5
Deploy Preview https://deploy-preview-778--accessible-autocomplete.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify[bot] avatar Nov 14 '25 17:11 netlify[bot]