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: toast - allow fine grained control over toast position #29990

Open
3 tasks done
rtpHarry opened this issue Nov 2, 2024 · 2 comments
Open
3 tasks done

feat: toast - allow fine grained control over toast position #29990

rtpHarry opened this issue Nov 2, 2024 · 2 comments
Labels

Comments

@rtpHarry
Copy link
Contributor

rtpHarry commented Nov 2, 2024

Prerequisites

Describe the Feature Request

The toast either gets in the way, or is out of eyesight.

I want to position it as a lower-third.

I have an ion-footer / ion-toolbar in my app, and if I put the toast at the bottom then it covers the ui and gets in the way.

Putting it at the middle or top, even I miss it sometimes, as the app developer. Modern phones are tall and its out of my eyesight when I'm pressing an ok or save button in the footer of the screen.

I wanted to adjust it but the component uses css shadow parts and the positioning is done in a part that is not exposed.

This doesn't work because it just moves the text inside the toast, not the background and actual toast:

.util-brand-toast::part(container) {
  transform: translate3d(0, -30%, 0) !important;
}

This doesn't work because its not exposed:

.util-brand-toast .toast-wraper.toast-bottom {
  transform: translate3d(0, -30%, 0) !important;
}

This does "work" but it affects the outer container, and I'm nervous that it's not a clean way of doing things:

.util-brand-toast {
  transform: translate3d(0, -30%, 0) !important;
}

It ends up like this:

image

Describe the Use Case

Allow fine grained control over the toast position

Describe Preferred Solution

Access to the .toast-wrapper or some setting method.

Describe Alternatives

No response

Related Code

No response

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Nov 2, 2024
@rtpHarry
Copy link
Contributor Author

rtpHarry commented Nov 2, 2024

after some more experimentation, ive tentatively gone with:

.util-brand-toast {
  height: 85%;
}

Which seems to be work, but I'm nervous about edge cases.

While researching this, for example, I read an issue with some problems with the Toast, occurring only when the keyboard is displayed.

I don't yet know how it will react with that, or if there is more that I might be tripped up by.

@aeharding
Copy link
Contributor

Tried positionAnchor?

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

No branches or pull requests

2 participants