feature: select drop down for icon - #34
Merged
Merged
Conversation
Owner
|
Thanks for the PR. I like the idea of making icon selection easier. One small concern: changing the icon field to a fixed dropdown means users can only choose from the icons in the list. Right now, users can type any Material Design icon name, like Could we keep it as a text input, but still show suggestions while typing? A Example: const handleIconChange = (e: React.ChangeEvent<HTMLInputElement>) => {
setIconInput(e.target.value);
setIcon(e.target.value.toLowerCase());
};<input
id="icon"
type="text"
value={iconInput}
onChange={handleIconChange}
list="material-design-icons"
autoComplete="off"
placeholder="Enter Material Design Icon name"
style={errors.icon ? { border: '1px solid #ff4444', boxShadow: '0 0 5px rgba(255, 68, 68, 0.3)' } : {}}
/>
<datalist id="material-design-icons">
{MATERIAL_DESIGN_ICON_OPTIONS.map((iconOption) => (
<option key={iconOption.value} value={iconOption.value}>
{iconOption.label}
</option>
))}
</datalist>This way we get the helpful suggestions, but users can still enter any Material Design icon they want. |
Contributor
Author
Owner
|
Perfect. Thank you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

I always thought its a bit inconvenient to have to go to material icon website to refer to the icon name and then input it by typing it into an input box.
i prefer a drop down select where user just select it. the list of icons is stored in /constant/materialDesignIcon. so that list can be extended if you want to add more options to it.
i would have preferred having a preview icon right beside the text in the drop down menu but this cant be done natively via html select, we need to use external library for that. maybe this can be considered in the future.