Skip to content

feat: toast html content #18204

Closed
Closed

Description

@Eraldo

Feature Request

Ionic version:

[x] 4.x

Describe the Feature Request

Current behavior:
Currently, toast shows only plain text even if you pass an URL or image link.

Expected behavior:
Toast should show plain text, links and images properly.

Describe Preferred Solution

Allow strings including html in toast service.

Describe Alternatives

Allow providing a custom component to toast service (like modal service does).

Related Code

Additional Context

Activity

  1. jaipresto commented on May 6, 2019

    @jaipresto

    This would be good. I looked for a long time for something equivalent and compatible with Ionic/Angular. I settled on Popper.js (fantastic wrapper here), which is insanely flexible and very lightweight. But obviously native Ionic capability would be better.

  2. cjorasch commented on May 6, 2019

    @cjorasch

    There are lots of places where it would be useful for a property to have a JSX value so that it can handle complex content. This includes alerts, pull to refresh, etc. Some of these are currently handled as string html but that feels pretty awkward when working in JSX. The simplest approach would seem to be typing the property as JSX but I think there are some use cases where a component is used from vanilla javascript that maybe prevents that approach.

    Possibly use JSX.Element | string for the property and only complex content can be done in JSX?

    JSX seems like it would simplify future component enhancements vs. constantly adding incremental properties of css values to change the displayed content.

  3. added
    type: feature request
    package: core
    on May 6, 2019
  4. ionitron-bot commented on Jun 29, 2019

    @ionitron-bot

    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.

  5. locked and limited conversation to collaborators on Jun 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

package: coretype: feature request

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions