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
Problem with too long labels #277
Comments
Yes, we should find a solution here, thanks for reporting this! I updated the sample: http://www.wwwendt.de/tech/fancytree/demo/sample-multiline.html and tried this CSS, which looks good in IE, FF, and Chrome except that the title is too wide:: span.ws-wrap span.fancytree-title {
white-space: normal;
} This variant looks perfect on Firefox, but is not indented on IE & Chrome: span.fancytree-node {
-moz-display: flex;
-webkit-display: flex;
-ms-display: flex;
display: flex;
}
span.ws-wrap span.fancytree-title {
white-space: normal;
} Finally, this variant breaks on all 3 browsers: span.ws-wrap span.fancytree-title {
white-space: normal;
-moz-display: flex;
-webkit-display: flex;
-ms-display: flex;
display: flex;
} any thoughts? |
Hi, thank you to consider this ;-) We should ask some CSS expert about this, I have some under the hand here, I will see with them and come back to you when I found a reasonable solution. Gauthier |
cool :-) |
Hi @mar10 a CSS worker had finally time to look at this here, here is the result, use padding instead of white-space... ul.fancytree-container { .fancytree-title > p { .fancytree-title > h3 { What do you think of this? Gauthier |
Hi, thanks for your efforts! Requiring a This may be because I recently changed the css a bit, in order to implement the ext-wide extension. Could you post the CSS that works for you in sample-multiline.html? |
Hi, we basically ran into the same issue when using version 2.7.0 and the skin lion theme, i.e. a small container overflow like in the image from an earlier post in this thread: But this also happened for single line nodes. Upon further analysis, I found the root cause and developed a fix as a CSS override because we didn't want to go into fancytree's source code. The container overflow is caused by the current strategy of aligning the node's contents horizontally. This will inevitably make the node's title element assume the full width of its container but pushed outwards by the expander and icon element in front of it. While this could be fixed by assigning a dynamic width to the title element (e.g. width: calc(100% - [width of preceding icons]), this CSS property doesn't work in IE9 and IE8 (see: http://caniuse.com/#search=calc ) Therefore I modified the layout strategy for the node's children by using absolute positioning for the icons and making room for them within the title element via padding-left. This override looks like this and is proven to work flawlessly with all browsers incl. IE8+: span.fancytree-node { span.fancytree-expander { span.fancytree-icon { span.fancytree-title { Of course this fix might not be perfect for other themes or features we aren't using in our application (a huge global extranet ordering system for a multi-billion $ company). But I think the different layout strategy is worth considering as it works with single and multi lines as well. |
thanks for sharing this. |
Is there a solution to word wrapping in latest version of fancytree? |
@mar10 When I shrink the browser, ext-wide isn't doing the wordwrap for the title. |
Figured out a workaround for now to address it. Here is my renderNode function
|
thanks |
For me, this CSS rule let titles wrap:
Don't know whether it will work for others. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hi,
we are using fancytree 2.2.0 for one of our project, it displays list of elements, the "problem" is that the label is displayed on one line and in case the label is very long, an horizontal scroll is displayed.
It is not a big issue but we managed to correct this by changing :
/* instead of 'no-wrap' */
ul.ui-fancytree.fancytree-container {
white-space: normal;
}
span.fancytree-node {
display: flex;
}
The problem is the use of "display:flex" that does not work on older browsers...
With IE8, here is the result :
So I do not know if it is an issue to you, and if so, is there a way to correct this so it works also with older browsers?
Thank you!
Gauthier
The text was updated successfully, but these errors were encountered: