Skip to content

Commit

Permalink
amelioration(review): tech review
Browse files Browse the repository at this point in the history
Co-authored-by: Colin Darie <colin@darie.eu>
  • Loading branch information
2 people authored and Martin committed Dec 13, 2023
1 parent 786d553 commit e375095
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .scss-lint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
exclude:
- 'app/assets/stylesheets/reset.scss'
- 'app/assets/stylesheets/direct_uploads.scss'
- 'app/assets/stylesheets/dsfr.scss'
- 'app/assets/stylesheets/dsfr_override.scss'

linters:
BangFormat:
Expand Down
7 changes: 0 additions & 7 deletions app/assets/stylesheets/dsfr.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@ trix-editor.fr-input {
width: 100%;
}
}
.fr-autocomplete{
// override dsfr chevron down which is
// --data-uri-svg: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z'></path></svg>");
// use a magnifier instead
--data-uri-svg: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' viewBox='0 0 24 24' ><path fill='%23161616' d='M12,13.1l5-4.9l1.4,1.4L12,15.9L5.6,9.5l1.4-1.4L12,13.1z'/></svg>");
background-image: var(--data-uri-svg);
}
}

@media (max-width: 62em) {
Expand Down
9 changes: 9 additions & 0 deletions app/assets/stylesheets/dsfr_override.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.fr-ds-combobox {
.fr-autocomplete{
// override dsfr chevron down which is
// --data-uri-svg: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z'></path></svg>");
// use a magnifier instead
--data-uri-svg: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' viewBox='0 0 24 24' ><path fill='%23161616' d='M12,13.1l5-4.9l1.4,1.4L12,15.9L5.6,9.5l1.4-1.4L12,13.1z'/></svg>");
background-image: var(--data-uri-svg);
}
}
4 changes: 0 additions & 4 deletions app/components/dsfr/combobox_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ def html_input_options
}.compact
end

def hidden_html_options
@hidden_html_options || {}
end

def input_id
@input_html_options[:id]
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
.fr-ds-combobox-input
%input{ value: selected_option_label_input_value, **html_input_options }
- if form
= form.hidden_field name, value: selected_option_value_input_value, form: form_id, **hidden_html_options
= form.hidden_field name, value: selected_option_value_input_value, form: form_id, **@hidden_html_options
- else
%input{ type: 'hidden', name: name, value: selected_option_value_input_value, form: form_id, **hidden_html_options }
%input{ type: 'hidden', name: name, value: selected_option_value_input_value, form: form_id, **@hidden_html_options }
.fr-menu
%ul.fr-menu__list.hidden{ role: 'listbox', hidden: true, id: list_id, data: { turbo_force: :browser, options: options_json, url:, hints: hints_json }.compact }
.sr-only{ aria: { live: 'polite', atomic: 'true' }, data: { turbo_force: :browser } }
Expand Down
1 change: 1 addition & 0 deletions app/javascript/controllers/autosubmit_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export class AutosubmitController extends ApplicationController {
declare readonly submitterTarget: HTMLButtonElement | HTMLInputElement;
declare readonly hasSubmitterTarget: boolean;
declare readonly inputTarget: HTMLInputElement;
declare readonly hasInputTarget: boolean;

#dateTimeChangedInputs = new WeakSet<HTMLElement>();

Expand Down

0 comments on commit e375095

Please sign in to comment.