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

Allow to replace an element instead of append to body for web rendering #1443

Merged
merged 2 commits into from
Nov 5, 2022

Conversation

traxys
Copy link
Contributor

@traxys traxys commented Sep 19, 2022

In case you want to have the application at the start of the page and some other content after it just appending to the body won't work

With this change you can add a <div id="iced_root"></div> and it will be replaced by the canvas

@13r0ck
Copy link
Member

13r0ck commented Sep 20, 2022

How cool would it be to have an Elm lang package that allows for Iced embeds using this!
Elm could handle all the SEO, pages, general web stuff, and Iced could be for the parts that don't need SEO and/or rendering of more complicated features.

Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This was long overdue 🙇

I have introduced a target field to our PlatformSpecific settings that allows users to provide the identifier of the DOM node they want to target. This way, we avoid hardcoding iced_root and, at the same time, we allow users to easily embed multiple iced applications in a single website.

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

Successfully merging this pull request may close these issues.

None yet

3 participants