-
Notifications
You must be signed in to change notification settings - Fork 77
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
[Autocomplete] Provide a way to remove the search icon #11224
Comments
setRequestedIcon is also weird because it will use the default icon for the type if its an empty string but not null or undefined. calcite-design-system/packages/calcite-components/src/utils/dom.ts Lines 328 to 338 in 732933a
|
IIRC, the
There might be some inconsistencies or follow-up needed due to Stencil's quirks with props of mixed type. |
Agree with this behavior. FWIW, the Figma version has a toggle for designers to turn the icon on/off (at the time, I think I assumed developers could do the same 😆). We're setting the default to I also wanted to point out that Combobox is also different in this regard. It has a |
Some type of input have default icon - which you can opt into with the boolean, and changes depending on "type" value. Combobox doesn't have that "type" property, so there wouldn't necessarily be a default icon there - "placeholder-icon" gets replaced with a selected Combobox Item's "icon" prop (if available), which is why we opted for a distinct name there (vs. "icon") |
Those make sense, this also happens though:
It just makes it a little weird for a user to remove the icon. They have to specifically use |
@jcfranco another problem is that the an
Should we proceed with these inconsistencies and update the utility to handle both cases or should we make changes to be consistent between them? |
This is expected and the correct behavior. IIRC, this was caused by Stencil's handling of mixed types. Side note: The internal 3.0 breaking change release doc and the breaking change notes in PR #10482 touch on this. After re-reading, we might want to add more detail to clarify.
This seems like a bug. According to the doc and previously described behavior, this shouldn't display an icon, right? |
Ok, so |
Correct; falsy values should not show an icon. |
this is one rabbit hole 🕳️ Because we have CSS using calcite-design-system/packages/calcite-components/src/components/input/input.scss Lines 299 to 309 in 2911675
Should I fix as part of this or follow up issue @jcfranco? |
Another issue: When we have <calcite-alert icon></calcite-alert> When we get the value of So we can't really treat Its being treated as true in 2x and 3x currently. |
**Related Issue:** #11224 ## Summary - allow icon to be set false - add tests BEGIN_COMMIT_OVERRIDE END_COMMIT_OVERRIDE
Installed and assigned for verification. |
Verified with <!-- Custom icon -->
<calcite-autocomplete icon="banana"></calcite-autocomplete>
<!-- No icon -->
<calcite-autocomplete id="autocompleteNoIcon"></calcite-autocomplete> document.getElementById("autocompleteNoIcon").icon = false; |
Check existing issues
Actual Behavior
Currently, the search icon cannot be removed.
I wonder if we should just not set the icon like default just as the
input
component does? That way, there's no icon by default and a developer doesn't have to set the icon to false using JS.Because we set the
input
type tosearch
in the autocomplete component, when a user sets the icon to an empty string (icon="") it will default to the search icon because the input component defaults to the input type icon. Maybe it shouldn't? Its kind of odd because I would expect setting an icon prop to "" to remove the icon.See https://codepen.io/Matt-Driscoll/pen/YPKYbZK?editors=1010
@jcfranco @ashetland @SkyeSeitz @matgalla would love your thoughts here.
Expected Behavior
The ability to remove the search icon.
Reproduction Sample
https://codepen.io/Matt-Driscoll/pen/XJrVwpB?editors=1010
Reproduction Steps
Reproduction Version
3.0.0-90
Relevant Info
questions:
input
reconsider setting the icon to the input's type when the icon prop is set to an empty string? cc @eriklharperRegression?
No response
Priority impact
impact - p1 - need for current milestone
Impact
No response
Calcite package
Esri team
ArcGIS Maps SDK for JavaScript
The text was updated successfully, but these errors were encountered: