You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I somewhat understand the issues related how the react-contenteditable has to prevent rerenders in certain scenarios (or something like that from 161. Couldn't say if this is related to that per se but anyways...
I'm trying to enforce a max text length on my title field content editable, doing something like this inside handleChange setTitle(e?.currentTarget?.innerHTML.slice(0, 300));
It doesn't stop the the text from rolling past 300 characters so I added a hacky forceUpdate() call after calling setTitle
And this sort of works. But of course it is an awful practice and leads to bugs. It was more of just a test.
But without the forceUpdate the content editable doesn't enforce the max length while typing. It does however clip the text when i move the mouse in and out of hovering the content editable. I assume this is all related to the content editable preventing rerenders.
Just wondering if there are any work arounds at all to enforce a max text length. I don't think this is remotely possible but an alternative I'd be happy with is turning all the characters past 300 red. I think that sounds far more impossible though!! Thanks for any input, even if it is just saying max length this isn't possible.
The text was updated successfully, but these errors were encountered:
I somewhat understand the issues related how the react-contenteditable has to prevent rerenders in certain scenarios (or something like that from 161. Couldn't say if this is related to that per se but anyways...
I'm trying to enforce a max text length on my title field content editable, doing something like this inside handleChange
setTitle(e?.currentTarget?.innerHTML.slice(0, 300));
It doesn't stop the the text from rolling past 300 characters so I added a hacky forceUpdate() call after calling setTitle
And this sort of works. But of course it is an awful practice and leads to bugs. It was more of just a test.
But without the forceUpdate the content editable doesn't enforce the max length while typing. It does however clip the text when i move the mouse in and out of hovering the content editable. I assume this is all related to the content editable preventing rerenders.
Just wondering if there are any work arounds at all to enforce a max text length. I don't think this is remotely possible but an alternative I'd be happy with is turning all the characters past 300 red. I think that sounds far more impossible though!! Thanks for any input, even if it is just saying max length this isn't possible.
The text was updated successfully, but these errors were encountered: