-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
textarea cannot rendered correctly. #2008
Comments
Do you have an example? |
MacOS 10.14
same behaviour as @HelenGiser's. |
+1 |
I was able to reproduce this here Text that would wrap is placed all on one line and becomes cut off |
same problem. |
Same problem |
same problem in rc5 |
I have the same problem with rc5: The text is shown in one single line in the vertical middle of the text field. |
Same problem with rc5: The text is shown in one single line in the vertical middle of the text field. |
See pull request #2132 |
As long as this is not merged, a fixed version is available on npm as "@nidi/html2canvas": "1.0.0-rc.8" |
it works. thank you |
Hello |
When textarea element show muti lines, it will lost '\n', like: AAAAAA\n
|
Please let me know how I can get rc8 version? I don't understand where to get - a fixed version is available on npm as "@nidi/html2canvas". I am working on an educational site that students are actually using for remote learning right now and I really need to get textarea working. Thanks for any help! |
add |
I was able to find html2canvas 1.0.0-rc.7 at https://www.npmjs.com/package/@nidi/html2canvas but not rc.8... Am I missing something? |
I tried the rc.7 version today and was unable to save the file. Not sure why. Just got spinning wheel that never completed. |
I see rc.8 on npmjs.com and I'm using it in my project, so it really is there :) |
I searched npmjs.com for "@nidi/html2canvas": "1.0.0-rc.8" but it tells me 0 packages found so I guess I don't know how to find it... |
@wsj195328 here's an example with newlines: http://jsfiddle.net/3knhoL1a/ |
@sstudebaker just search for |
Here is my confusion - when I open the js file it says html2canvas 1.0.0-rc.7. so I guess I have the right one but it is not working for my script. Save function is on this page: https://piclits.com/piclit/79/ If you create a piclit in freestyle mode and then save under Options (you would need to register) but newlines are not captured. I tried the newer js and it would not save - just kept spinning. // ON SAVE CREATE IMAGE AND SAVE WORDS
The two attached files show the piclit in edit mode and then when saved. |
You are right about the version. |
when will this version merge to niklasvh/html2canvas? |
@nidi3 Thanks for your support ! |
replace textarea to container contenteditable!!! |
@nidi3, I did not get the fix. I added "@nidi/html2canvas": "1.0.0-rc.8" and "@nidi/html2canvas": "1.0.0-rc.11" in package.json file and run the command 'npm install' and 'npm run build'. Content of generated html2canvas.js exactly same as version 1.0.0-rc.7. Please suggest how to get version 1.0.0-rc.8 or higher. |
Work like a charm! thanks @mamtou ~ |
Still not fixed? |
@niklasvh is there any update on this issue? |
Issue is still there in the latest version 1.3.2 |
this works but isn't ideal for virtual DOM libraries like react.
this also didn't work for me. |
Will this ever be merged into the main branch? I'm experiencing an issue with the patch above that applies a padding to a textarea, cutting off text sometimes, and I don't want to submit further issues with the patch until it's merged into master. |
@aarenstade My workaround was to create a similarly styled div in its place: html2Canvas(containerRef.current, {
onClone: (clonedDocument) => {
Array.from(clonedDocument.querySelectorAll('textarea')).forEach((textArea) => {
const div = clonedDocument.createElement('div')
div.innerText = textArea.value
div.style.border = '1px solid #9b9b9b'
div.style.padding = '0 10px'
textArea.style.display = 'none'
textArea.parentElement.append(div)
})
}
}) An added benefit to this approach is that it also avoids the issue of overflowing vertical content getting cut off |
After thinking about the same thing, I came to the following conclusion. example site |
v1.4.1 textarea still not support. So I recommend to switch to |
still not support yet in v1.4.1 :< |
@chawes13 this worked great! Only changes I had to make were changing |
Would be great to have this added. Curious if this issue might also be connected to: @chawes13 It seems like you have found a great work around, as mentioned by @florton. Any chance you could comment on how to apply your approach to the first jsfiddle below? I hope that a similar approach may also work for Multi-select in the second js-fiddle below. TextArea https://jsfiddle.net/a8st153g/ Multi-select: |
@vnijs Here you go: The multiselect is a bit different - I think there might be a bug in the cloning process (as pointed out in #2166). I guess you could hack it a bit with the following. I can't say I recommend it though 😅. |
Thanks @chawes13! This was very helpful. The below seems to work for both #2008 and #2166. The only issue I haven't been able to figure out yet is how to keep the elements in the same order. See the example below where the "Data Filter" is added below the two other textAreas while it is listed first in the actual app. Do you perhaps know of a simple way to keep the elements in the same order? Normal screenshot: Screenshot from html2canvas:
|
@vnijs You could wrap each of your text area elements in a containing element or you could use the |
Thanks @chawes13! Wrapping each text area in a containing elements works really well. I'm still missing one piece of the puzzle related to vertical cropping after after making adjustments during |
Thank you people :D |
Use div contenteditable instead of a textarea, works fine with html2canvas See fiddle https://jsfiddle.net/dkwnfh6v/ |
Please resolve this issue |
Hi,
I was faced that textarea cannot break line with capturing
hopes give some help
thanks!
Specifications:
The text was updated successfully, but these errors were encountered: