We’re looking to give HOT a bit of breathing room, which is great but it doesn’t work so well when we edit the values:
The styles we’re using are the following:
.handsontable {
td, th, textarea {
font-size: 0.8rem;
line-height: 2rem;
padding-left: 0.5rem;
padding-right: 0.5rem;
}
.htRight .htAutocompleteArrow {
padding-left: 0.25rem;
}
.htRight.highlight,
.htRight {
padding-right: 0.5rem;
text-align: right;
}
}
The thing is, when HOT calculates the size of the textarea
to lay it over the original cell, it doesn’t account for any extra padding (added by me) and the width is wrong (the calculated size + the extra padding)
If I remove the padding, it displays at the proper size:
Perhaps I am doing this wrong and there is a built-in way to solve this.
I’ve tried box-sizing
but that doesn’t help.
On a related note, we would also like a bit more control over the editor textarea
, specifically to give it the exact same styling as the cell so it has more of an “inline edit” feel (even just matching the alignment!) as at the moment it really does feel like a separate editor.
It seems that two things could potentially solve this (not that I know the lib at all, so perhaps this would cause other problems):
- size the
.handsontableInputHolder
container, then set thetextarea
to expand to fill it - copy the cell’s classes to the
textarea
which would set things like alignment and line height:
Obviously that isn’t going to happen any time soon.
Any ideas what I can do in the meantime?
Either through styling or JS manipulation?