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

Elements with empty textnode doesn't collapse on xml opening #31

Open
fpierrat opened this issue Apr 26, 2018 · 0 comments
Open

Elements with empty textnode doesn't collapse on xml opening #31

fpierrat opened this issue Apr 26, 2018 · 0 comments

Comments

@fpierrat
Copy link

Hi,
Impossible to have a collapsed empty text node:
"intro": {hasText:true, asker: x.askLongString, collapsible: yes, collapsed: yes, oneLiner: yes},
Whatever I tried (collapsed, collapsable, collapsoid, oneLiner...), this text node is rendered uncollapsed on opening my XML when the <intro> tag is empty.
Note: yes is a function returning true, which works perfectly well for any other elements (as well as for this element when not empty).

I finally removed the second condition on line 546 and it now displays as expected (see captures attached):
if(spec.collapsed(element) && element.children.length>0) classNames+=" collapsed";

I suppose I'll have to deal with side-effects, haven't found any yet.
Thanks for anybody telling me what better solution should have been employed...

collapse

@fpierrat fpierrat changed the title Elements with empty textnode Elements with empty textnode doesn't collapse on xml opening Apr 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant