How to prevent newlines in cells

For my table, the cells should not have newlines in them (either from keyboard input or pasted content)

how can we prevent newlines in cells during entry or paste ?

Hi @schwabe4

Please share a code demo where the problem can be replicated along with steps how to reproduce it.

So you have some pasted content on your clipboard, let’s say its:

this is a line
this is a newline

if you copy that and paste into a HoT cell, there are 2 lines inserted.
I’m trying to prevent this behavior so that the new line is stripped out ie-

so that the result is in the cell after pasting:
this is a line this is a newline

@schwabe4

I’m not able to reproduce the issue this way. Please modify this example so the problem is replicable there: Handsontable example - JSFiddle - Code Playground

you can replicate the problem by pasting the 2 lines of text i shared into any cell

I want to prevent newlines in cells; newlines are invalid input for my particular use case ie- a product number that should never be 2 lines

@schwabe4

You can use the wordWrap option to avoid this situation. Here’s an example: Handsontable example - JSFiddle - Code Playground