Handle cell text overflow with ellipsis or clipping#341
Handle cell text overflow with ellipsis or clipping#341nmichaud wants to merge 3 commits intophosphorjs:masterfrom
Conversation
| this.backgroundColor = options.backgroundColor || ''; | ||
| this.verticalAlignment = options.verticalAlignment || 'center'; | ||
| this.horizontalAlignment = options.horizontalAlignment || 'left'; | ||
| this.overflow = options.overflow || 'ellipsis'; |
There was a problem hiding this comment.
From an efficiency/cost perspective, it should be clip, but from a default UX experience I feel ellipsis are more user friendly. What do you think?
There was a problem hiding this comment.
I was going based on what line 334 says.
There was a problem hiding this comment.
Ah sorry, I was saying that either value as default makes sense, depending
on whether you want to optimize the speed or the UX.
| switch (hAlign) { | ||
| case 'left': | ||
| textX = config.x + 2; | ||
| textX = config.x + 8; |
There was a problem hiding this comment.
Why the change to the original padding? Should we make that configurable?
There was a problem hiding this comment.
Probably should be configurable. I found a slightly larger padding led to better white space balancing and made the grid much easier to scan and read when using it with real data.
There was a problem hiding this comment.
IIRC I got the original padding values from Excel on Windows.
There was a problem hiding this comment.
Ok, I'll change it back, or add it as an option.
|
Thanks for this! I made a few comments, but it looks really good as a whole. |
This provides an option for the default TextRenderer to show ellipses instead of clipping the text at the cell boundary.