I've set a placeholder value and inspecting the form_select component, if a placeholder key is passed in the form_select options it sets value: nil, which should allow the disabled option to be displayed first, yet it doesn't
### From select source code
def render_options
if placeholder
#### HERE
option value: nil, disabled: true, selected: init_value.nil?, text: placeholder
#### HERE
end
select_options.to_a.each do |item|
option item_label(item), value: item_value(item), disabled: item_disabled?(item)
end
end
###
The issue lies in setting value: nil in the render options method showed above in the core component select.rb. It is not being rendered as a property in HTML and therefore not displaying the placeholder. Could be fixed by simply setting value: ''.
Which versions of Matestack, and which browser/OS are affected by this issue? Did this work in previous versions of Matestack?
Matestack-ui-core 2.1.0
Tested on Chrome and Safari
What is the current behavior?
I've set a placeholder value and inspecting the form_select component, if a placeholder key is passed in the form_select options it sets
value: nil
, which should allow the disabled option to be displayed first, yet it doesn'tWith the following form_select
The
value
property is not being set in the rendered HTML option elementWhat is the expected behavior?
The rendered HTML should be
The issue lies in setting
value: nil
in the render options method showed above in the core componentselect.rb
. It is not being rendered as a property in HTML and therefore not displaying the placeholder. Could be fixed by simply settingvalue: ''
.Which versions of Matestack, and which browser/OS are affected by this issue? Did this work in previous versions of Matestack?
Matestack-ui-core 2.1.0 Tested on Chrome and Safari