File tree Expand file tree Collapse file tree
components/alchemy/ingredients
javascript/alchemy_admin/components
spec/components/alchemy/ingredients Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,14 +11,15 @@ def input_field
1111 value ,
1212 disabled : !editable?
1313 )
14+ concat color_field_tag ( nil , value , disabled : disabled? )
1415 else
1516 concat select_tag (
1617 form_field_name ,
1718 color_options . join . html_safe ,
1819 disabled : !editable?
1920 )
21+ concat color_field_tag ( form_field_name , value , disabled : disabled? )
2022 end
21- concat color_field_tag ( form_field_name , value , disabled : disabled? )
2223 end
2324 end
2425
Original file line number Diff line number Diff line change @@ -21,11 +21,8 @@ class ColorSelect extends HTMLElement {
2121 this . #toggleColorPicker( event . val === "custom_color" )
2222 )
2323 } else {
24- if ( this . textInput ) {
25- this . colorInput . addEventListener ( "input" , this )
26- this . textInput . addEventListener ( "input" , this )
27- this . textInput . value = this . colorInput . value
28- }
24+ this . colorInput ?. addEventListener ( "input" , this )
25+ this . textInput ?. addEventListener ( "input" , this )
2926 this . #toggleColorPicker( true )
3027 }
3128 }
Original file line number Diff line number Diff line change 3434 context "with no color option" do
3535 let ( :settings ) { { } }
3636
37- it "renders a text input field with a color picker" do
37+ it "renders a text input field and a color picker without name attribute " do
3838 is_expected . to have_selector ( "input[type='text'] + input[type='color']" )
39+ is_expected . to_not have_selector ( "input[type='color'][name]" )
3940 end
4041 end
4142
You can’t perform that action at this time.
0 commit comments