Skip to content

Commit ceed348

Browse files
authored
Merge pull request #63 from abhishekxix/feature/multi-select-form-reference
Add form reference attribute to tp-multi-select
2 parents 9ff52b5 + eac3137 commit ceed348

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/multi-select/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,10 @@ const value = multiSelect.value;
8888

8989
| Attribute | Required | Values | Notes |
9090
|-----------------|----------|--------------------------|-------------------------------------------------------------------------------------|
91-
| name | Yes | <name of the form field> | Whether the height of the slider changes depending on the content inside the slides |
91+
| name | Yes | \<name of the form field\> | The name that is given to the form field. |
9292
| multiple | No | `yes`, `no` | Whether the field needs to be a single or mult-select form field. Yes by default |
9393
| close-on-select | No | `yes` | Whether to close the options when a value is selected |
94+
| form | No | \<id of the form\> | The id of the form with which the select input will be linked and submitted. |
9495

9596
## Events
9697

src/multi-select/tp-multi-select.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ export class TPMultiSelectElement extends HTMLElement {
198198
if ( ! selectElement ) {
199199
selectElement = document.createElement( 'select' );
200200
selectElement.setAttribute( 'name', this.getAttribute( 'name' ) ?? '' );
201+
selectElement.setAttribute( 'form', this.getAttribute( 'form' ) ?? '' );
201202

202203
if ( 'no' !== this.getAttribute( 'multiple' ) ) {
203204
selectElement.setAttribute( 'multiple', 'multiple' );

0 commit comments

Comments
 (0)