-
Notifications
You must be signed in to change notification settings - Fork 543
feat: add placeholder support to empty lists of applied controls in selector #2882
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
base: main
Are you sure you want to change the base?
Changes from all commits
a7ab7ea
ed03560
9dd4fc6
22e7644
0e2726b
2e84f52
6b12378
cb11fd8
5e1affe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,6 +40,7 @@ | |
| disabled?: boolean; | ||
| hidden?: boolean; | ||
| translateOptions?: boolean; | ||
| placeholder?: string | null; | ||
| options?: Option[]; | ||
| optionsEndpoint?: string; | ||
| optionsDetailedUrlParameters?: [string, string][]; | ||
|
|
@@ -88,6 +89,7 @@ | |
| disabled = false, | ||
| hidden = false, | ||
| translateOptions = true, | ||
| placeholder = m.selectPlaceholder(), | ||
| options = [], | ||
| optionsEndpoint = '', | ||
| optionsDetailedUrlParameters = [], | ||
|
|
@@ -371,7 +373,7 @@ | |
| cachedOptions = selected; | ||
| }); | ||
| run(() => { | ||
| $effect(() => { | ||
| // Only update value after options are loaded | ||
| if (!isInternalUpdate && optionsLoaded && !arraysEqual(selectedValues, $value)) { | ||
| isInternalUpdate = true; | ||
|
|
@@ -457,6 +459,8 @@ | |
| duplicates={false} | ||
| key={JSON.stringify} | ||
| filterFunc={fastFilter} | ||
| {placeholder} | ||
| --sms-placeholder-color="#9ca3af" | ||
|
||
| > | ||
| {#snippet option({ option })} | ||
| {#if optionSnippet} | ||
|
|
@@ -552,3 +556,9 @@ | |
| <p class="text-sm text-gray-500 whitespace-pre-line">{helpText}</p> | ||
| {/if} | ||
| </div> | ||
|
|
||
| <style> | ||
| .control :global(input::placeholder) { | ||
| font-style: italic; | ||
| } | ||
| </style> | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -28,3 +28,10 @@ | |||||
| bind:value | ||||||
| oninput={search} | ||||||
| /> | ||||||
|
|
||||||
| <style> | ||||||
| #search-input::placeholder { | ||||||
| font-style: italic; | ||||||
| color: #9ca3af; | ||||||
|
||||||
| color: #9ca3af; | |
| color: theme('colors.gray.400'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Only one
run()call was changed to$effect()while three otherrun()calls remain on lines 364, 371, and 386. If this change is intentional due to different reactivity requirements, it would be helpful to add a comment explaining why. Otherwise, consider updating allrun()calls consistently for uniformity.