-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
bug: Customisation limitations of inputs in Ionic 7 #27905
Comments
Thanks for the report. There are a few requests here, so I'll address each one individually. Passing custom icons/decorations/text to Slotting custom decorations/icons in Multi-row input with select combination does not work as expected This isn't a pattern I recommend doing. In your example, the select arrow rotates up when clicking into the first/last name inputs. This is confusing because it gives the impression that the inputs are somehow linked to the select which is not the case. In fact, the Ionic 7 behavior, while noted as "broken", is actually the correct behavior. The select is not tightly coupled to the inputs, though the select can still be used to change the title. Additionally, the select arrow does not rotate up when one of the inputs are focused. Toggle with a prefix and label This is already possible via the <ion-item>
<ion-label>Text A</ion-label>
<ion-toggle slot="end">Text B</ion-toggle>
</ion-item> Note that for accessibility purposes "Text B" would be considered the text associated with the toggle and "Text A" would be decorative text. Alternatively, you can have neither text associated with the toggle. In that case, you should add an <ion-item>
<ion-label class="custom-label ion-text-nowrap">
<div>Text A</div>
<div>Text B</div>
</ion-label>
<ion-toggle aria-label="My Toggle" slot="end"></ion-toggle>
</ion-item>
<style>
.item ion-label.custom-label {
display: flex;
justify-content: space-between;
}
</style> |
Thank you for the super quick response Liam Multi-row input with select combination does not work as expected Multi-row input with select combination does not work as expected Anyways, this is more of a UX discussion, and although I think would be a nice if there were some ways to group fields together visually, I think it's totally acceptable if this is not supported. Toggle with a prefix and label Would you not recommend to use For now, we can keep using the legacy version. It might be nice to suppress the console warnings if Edit: I found this as a feature request here too. The warning is great, but I think that if the developer has explicitly included the |
Ah ok I see. Yeah this isn't something we recommend doing. An
So |
Regarding the multi-row, I just learned about the Good to know that ion-label will not be deprecated completely. Thanks you for the quick response, I'll close the issue since the remaining issue is already being tracked. |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Prerequisites
Ionic Framework Version
v7.x
Description
The new input and label implementation have introduced some limitations regarding customisations of input fields. I have labeled this issue as a bug since it used to be possible with the previous implementation of inputs and labels. Feel free to change this.
So some of the inputs that we are trying to migrate to Ionic 7, but are seemingly not possible are:
Code Reproduction URL
https://codepen.io/SaroGFX/full/abQPaNL
Additional Information
In case there are other workarounds currently available, I'd be happy to learn about them of course.
I wouldn't mind if Ionic would keep supporting the
ion-label
component, if that's what's needed to make such customisations possible.The text was updated successfully, but these errors were encountered: