reactgrid
reactgrid copied to clipboard
[feature request] Wrap text
Describe the feature I cannot seem to find the wrap text feature for cells in a column. Here is how it works in Excel. Is there a way to do this? If not, I would like to request this feature.
Current behavior All cells are unwrapped making paragraphs difficult to edit.
Expected behavior A flag for columns to make the wrap text feature similar to how Microsoft Excel wraps the text.
Screenshots or gifs
Her is a screenshot of how it is displayed in Excel.
Hello! The feature is achievable by creating a cell template which would render cell data in a div with desired css settings. You can also replace the edit mode behavior, e.g. by using text area instad of a plain input. Read more here
@czerwiukk I tried your solution with a custom renderer that does what you suggested. However, the size of the row does not change. How would you get the row height to respect the space needed for the wrapped text in that cell?
Hi, I investigated this issue and created this sandbox. My solution is not an official one and was created only to verify if such functionality is possible with current API. Do not use this in its current form, it needs refactoring, testing and additional handling of edge cases. Albeit, I hope it at least helps you find the proper direction. Please take a look and let me know ;)
Hi @DLowHP. Your sandbox is very promising. As you said, the functionality is possible and that is what is important. Thank you for taking the time!
You're welcome! I will close the issue now, if you need anything more just text me! ;)