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 => {
173173| ` inputReadOnly ` | boolean | ` false ` | Toggle the readonly state for the component. |
174174| ` invalid ` | boolean | ` false ` | Toggle the invalid state for the component. |
175175| ` 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. |
176177| ` placeholder ` | string | ` 'Select time' ` | Specifies a short hint that is visible in the input. |
177178| ` size ` | ` 'sm' ` \| ` 'lg' ` | ` null ` | Size the component small or large. |
178179| ` 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 = {
8484 inputReadOnly : false ,
8585 invalid : false ,
8686 locale : 'default' ,
87+ name : null ,
8788 placeholder : 'Select time' ,
8889 required : true ,
8990 size : null ,
@@ -105,6 +106,7 @@ const DefaultType = {
105106 inputReadOnly : 'boolean' ,
106107 invalid : 'boolean' ,
107108 locale : 'string' ,
109+ name : 'string' ,
108110 placeholder : 'string' ,
109111 required : 'boolean' ,
110112 size : '(string|null)' ,
@@ -334,8 +336,8 @@ class TimePicker extends BaseComponent {
334336 inputEl . type = 'text'
335337 inputEl . value = this . _date ? this . _date . toLocaleTimeString ( this . _config . locale ) : ''
336338
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 } `
339341 }
340342
341343 const events = [ 'change' , 'keyup' , 'paste' ]
You can’t perform that action at this time.
0 commit comments