Files
sure/app/components/DS/icon_picker.rb
T
Victor Dusart c8252ed15e feat(icons): add search field for icon selection (#2862)
* feat(icons): add search field for icon selection

* fix(icons): address review suggestions on the icon picker

* fix(goals): prevent the icon picker popover from collapsing

`updatePopupPosition` sets `bottom: 0px` when the popover would run past
the fold,
but never clears Tailwind's `top-full`.
With both offsets set and `height: auto`, CSS derives the height from
the offsets
instead of the content, collapsing the popover to 26px.

This PR is what makes it reachable: the search row (42px plus an 8px gap)
and the grid going max-h-40 -> max-h-52 grow the popover ~98px, moving the
overflow trigger point far enough to hit standalone /goals/new at 1280x800.

`h-fit` makes the height non-auto, so the over-constraint resolves by
ignoring `bottom`,
which is why categories, already carrying it, was never affected.
2026-08-11 23:44:24 +02:00

17 lines
514 B
Ruby

# frozen_string_literal: true
# `DS::IconPicker` is a shared, searchable lucide-icon grid.
#
# `method` is a parameter because the backing columns can differ:
# for now `categories.lucide_icon` and `goals.icon`.
class DS::IconPicker < DesignSystemComponent
attr_reader :form, :method, :icons, :placeholder
def initialize(form:, method:, icons:, placeholder: nil)
@form = form
@method = method
@icons = icons
@placeholder = placeholder || I18n.t("ds.icon_picker.search_placeholder")
end
end