File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -173,6 +173,7 @@ const timePickerList = timePickerElementList.map(timePickerEl => {
173
173
| ` inputReadOnly ` | boolean | ` false ` | Toggle the readonly state for the component. |
174
174
| ` invalid ` | boolean | ` false ` | Toggle the invalid state for the component. |
175
175
| ` locale ` | string | ` 'default' ` | Sets the default locale for components. If not set, it is inherited from the navigator.language. |
176
+ | ` name ` | string | ` null ` | Set the name attribute for the input element. |
176
177
| ` placeholder ` | string | ` 'Select time' ` | Specifies a short hint that is visible in the input. |
177
178
| ` size ` | ` 'sm' ` \| ` 'lg' ` | ` null ` | Size the component small or large. |
178
179
| ` time ` | date \| string \| null | ` null ` | Default value of the component |
Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ const Default = {
84
84
inputReadOnly : false ,
85
85
invalid : false ,
86
86
locale : 'default' ,
87
+ name : null ,
87
88
placeholder : 'Select time' ,
88
89
required : true ,
89
90
size : null ,
@@ -105,6 +106,7 @@ const DefaultType = {
105
106
inputReadOnly : 'boolean' ,
106
107
invalid : 'boolean' ,
107
108
locale : 'string' ,
109
+ name : 'string' ,
108
110
placeholder : 'string' ,
109
111
required : 'boolean' ,
110
112
size : '(string|null)' ,
@@ -334,8 +336,8 @@ class TimePicker extends BaseComponent {
334
336
inputEl . type = 'text'
335
337
inputEl . value = this . _date ? this . _date . toLocaleTimeString ( this . _config . locale ) : ''
336
338
337
- if ( this . _element . id ) {
338
- inputEl . name = `time-picker-${ this . _element . id } `
339
+ if ( this . _config . name || this . _element . id ) {
340
+ inputEl . name = this . _config . name || `time-picker-${ this . _element . id } `
339
341
}
340
342
341
343
const events = [ 'change' , 'keyup' , 'paste' ]
You can’t perform that action at this time.
0 commit comments