Open MiniSuperDev opened 1 week ago
Can you remove the early return
here?
@override
void parse(BuildTree tree) {
final e = tree.element;
if (e.localName == 'h1' || e.localName == 'h2') {
tree.register(headerOp);
return; // <- this one
}
return super.parse(tree);
}
You didn't allow the super WidgetFactory
to parse the tree so the id
attribute didn't register -> scrollToAnchor
cannot see the #h1
to scroll.
Hi, how to preserve the
scrollToAnchor
behavior for the headers when use a custom widget?The use case can be to make the title clickable and show a link button like a lot of webs.
In the following example when you register a
WidgetFactory
with aBuildOp
for the header thescrolToAnchor
it does not work, if you comment thefactoryBuilder
you can see the expected behavior.So, how can I do it?
Thank you