Hello Dan,
I got an error scrolling in a window when it contains a textarea. The textarea does not scroll with the window, but remains in place.
Attached is a link to the code:
In the code in the link, I changed the color of the textArea so that it would stand out, but it remained there even without changing the color.
tanks.
Hi Hadas, this, unfortunately, is expected behavior. Here is an explanation from the Docs:
/*
TextArea
zim class - extends a zim.Container which extends a createjs.Container
DESCRIPTION
TextArea creates an input text field by overlaying an HTML TextArea.
The TextArea is then overlayed with the createjs DOMElement
and scaled and positioned with ZIM code. This can also be used if selectable text is required
Access to the HTML tag is provided with the TextArea tag property.
So CSS Styles can be applied to the HTML tag as with any HTML textarea tag
The TextArea comes with a ZIM Rectangle in behind that you can adjust with parameters
or remove completely if you so desire using the TextArea background property
ie. myTextArea.background.alpha=0; or myTextArea.removeChild(myTextArea.background)
NOTE
due to the HTML tag being overlayed, the TextArea.resize() must be called if it is moved
(This is called automatically when the stage is resized)
It also means that a TextArea in a Window or List is probably not a good thing.
Consider using Label and then toggling a TextArea on mouseover and mouseout.
See https://zimjs.com/snips for an older discontinued example.
NOTE
if the TextArea is placed in a container and the container is removed or added again
the textArea must be manually removed or added again with textArea.removeFrom() or textArea.addTo().
This is so ZIM does not have to keep track of HTML tags each time a container is added or removed.
When using TextArea in a Pane or in Pages this will be automatically handled
only if the TextArea is directly in the Pane or the page (not nested in further Containers)
NOTE
rotation and skewing of TextArea is not supported - although might work with custom CSS transformations
NOTE
because of these limitations, consider the TextEditor or TextInput as a solution.
The TextEditor allows you to use a Label which is a proper part of the Canvas
and then change the label with a pop-up editor that includes a TextArea.
SEE: https://zimjs.com/cat/texteditor.html
TextInput is a one line input text field that is actually part of the canvas
SEE https://zimjs.com/explore/textinput.html
*/