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

feat: Remove ion-back-button text #29281

Closed
3 tasks done
KevinLeneschmidt opened this issue Apr 5, 2024 · 3 comments
Closed
3 tasks done

feat: Remove ion-back-button text #29281

KevinLeneschmidt opened this issue Apr 5, 2024 · 3 comments
Assignees
Labels

Comments

@KevinLeneschmidt
Copy link

KevinLeneschmidt commented Apr 5, 2024

Prerequisites

Describe the Feature Request

I want to be able to remove the text from the ion-back-button without using text="", because this breaks the page transitions like mentioned here.

Describe the Use Case

Sometimes, you want to use the ion-back-button without any text, just the icon.

Describe Preferred Solution

Explicitly setting text to null should remove any text from the ion-back-button, undefined can be still used to set the default 'Back' text.

Describe Alternatives

No response

Related Code

Link to a repo

Additional Information

Ionic forum link to the topic here

No response

@thetaPC
Copy link
Contributor

thetaPC commented Apr 5, 2024

Thank you for submitting the issue!

I strongly advise retaining the text for improved web accessibility. However, I understand your desire to hide it visually. This can be achieved using CSS since the text is accessible as a shadow part. The code snippet below demonstrates how to hide the text while ensuring it remains accessible to screen readers.

ion-back-button::part(text) {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

I'm closing this issue as it can be resolved via styling. If you have any other concerns, please open a new PR.

@thetaPC thetaPC closed this as not planned Won't fix, can't repro, duplicate, stale Apr 5, 2024
Copy link

ionitron-bot bot commented May 5, 2024

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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators May 5, 2024
@thetaPC
Copy link
Contributor

thetaPC commented May 6, 2024

Related PR

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants