Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/MakeDropdownTextDoubleClickable #153

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/components/satis/dropdown/component.css
Original file line number Diff line number Diff line change
@@ -35,8 +35,10 @@
@apply bg-white divide-gray-900 divide-opacity-25 shadow-gray-300 shadow-lg text-gray-900 text-opacity-75 dark:bg-gray-900 dark:shadow-gray-700 dark:shadow-lg dark:bg-opacity-75 dark:divide-gray-50 dark:divide-opacity-25 dark:text-gray-300;
}

.page_body .satis-dropdown .sts-dropdown .sts-dropdown-input{
.satis-dropdown .sts-dropdown .sts-dropdown-input{
@apply bg-white dark:bg-gray-900 dark:divide-gray-100;
pointer-events: all;
user-select: text;
}

.page_body .satis-dropdown .sts-dropdown-results-items{
2 changes: 1 addition & 1 deletion app/components/satis/dropdown/component.html.slim
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ div.satis-dropdown data-action="keydown->satis-dropdown#dispatch" data-controlle
.h-12.p-1.flex.rounded
.flex.flex-auto.flex-wrap
/ Input where you can search
input.p-1.px-2.appearance-none.outline-none.w-full.sts-dropdown-input.text-gray-800.dark:text-gray-300 data-action="input->satis-dropdown#search" data-satis-dropdown-target="searchInput" placeholder=placeholder autofocus=options[:autofocus]
input.text.p-1.px-2.appearance-none.outline-none.w-full.sts-dropdown-input.text-gray-800.dark:text-gray-300 data-action="input->satis-dropdown#search" data-satis-dropdown-target="searchInput" placeholder=placeholder autofocus=options[:autofocus] ondblclick="this.select()"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to work with stimulus events (dblclick) and then trigger the select of the input. Don't put normal JS directly in html.

https://onrails.blog/2018/04/11/lets-make-an-editable-header-using-stimulus-js/

div
/ Reset button
- unless @reset_button == false