-
-
Notifications
You must be signed in to change notification settings - Fork 602
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
Support other tags than div for ui.html #2610
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the pull request, Peter!
I just changed the demo to something that renders visually different than a div.
Very glad this was caught and fixed. I just going to post a new issue about this. You would expect these two lines to be equivalent, but they are not: img = ui.element ('img').props (f'src={ src }')
img = ui.html (f'<img src="{ src }">') Second line wraps |
@ed2050 As the documentation for
So the HTML content "<img ...>" is always wrapped in a container element, usually a ui.element('img').props(f'src={ src }')
ui.html(tag='img').props(f'src={ src }') |
Yes, with the Feb patch. Previously that wasn't possible. I'm using an older version. I find it very strange that unrequested Anyway all good now. |
@ed2050 I see your point, and I agree. When creating the |
Thanks @falkoschindler. Actually I'm not sure I support changing this behavior. While it is misleading, I favor code stability over unnecessary breaking changes. Even in a major release, I prefer as few breaking changes as possible. How about instead the tag parameter accepts a value of none to return the raw unaltered html? Otherwise it wraps with tag as current behavior. This could be made prominent in the docs by updating the first line:
|
I like the idea of making the tag optional, @ed2050! This gives full control to the user, while not breaking anything. 👍🏻 |
No description provided.