-
-
Notifications
You must be signed in to change notification settings - Fork 908
Add support for <details> and <summary> #507
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
Add support for <details> and <summary> #507
Conversation
…into feature/details-tag � Conflicts: � lib/html_parser.dart
…e interactable_element.dart fixes by @erickok
…ty details tag without errors
…e/details-tag # Conflicts: # lib/html_parser.dart
…into feature/details-tag � Conflicts: � lib/html_parser.dart � lib/src/layout_element.dart
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.
One small thing I noticed, I've asked for comment for some other things with from Eric. Feel free to chime in on those comments
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.
Still doesn't quite seem to do what you intend. I use this html:
<details>
<summary>I have keys but no doors. I have space but no room. You can enter but can’t leave. What am I?</summary>
A keyboard.
</details>
But both the summary and the details end up in the dropdown. I can click the widhet and it extends fine, but the summary text should be shown in the dropdown as 'title'.
@erickok looked into this and its very odd...
works as intended but your example doesn't. In your example, the list of children returned is
I render the first item as the title of the dropdown so the empty text messes with it. In my example it returns
so the dropdown renders correctly. I'll see if there's a way to work around this. |
@erickok can you check this again? I think I've solved it and hopefully prevented errors occurring in any edge case uses. |
I noticed that too, it seems this is only happening in your HTML because "A keyboard" isn't in a tag. If you use Do you have an idea how I would fix this? There is a param on the |
@erickok Never mind... it seems that setting this parameter doesn't actually override the alignment if it is set for the tree itself. This PR should be good to merge now. |
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.
All good now!
20210120_165459_1.mp4
Add support for HTML
<details>
dropdowns, along with<summary>
which functions as their title.Use this HTML to test the example in the above video: https://gist.github.com/tneotia/4200782025039d996dade4b2342a6899
I have had one issue with this though - the stuff in the
<summary>
tag also gets rendered in the dropdown portion and I cannot figure out how to remove/exclude that section of the tree when rendering the dropdown.