Hi Shawn,
Unfortunately, nothing works in your project.
Let me describe my sample in details so you can recreate:
- Make the
inputdiv editable when the scene is activated:
function onSceneActivated(doc, e) {
doc.getElement('input').textDom.contentEditable = true;
}
- Create
input clickedtimeline to change the background color, dim the separator line, and show Submit button. - Run
input clickedtimeline when theinputshape receivesmouse downevent for the first time:
function onInputMouseDown(doc, e) {
if (this.userClicked)
return;
this.userClicked = true;
doc.getTimeline('input clicked').start();
}
- Get text inputted, say thank you, hide submit button when submit button is clicked
function onSubmitClicked(doc, e) {
var inputDom = doc.getElement('input').textDom;
// get text input
var textInput = inputDom.innerText;
// show thank you
inputDom.contentEditable = false;
inputDom.innerHTML = 'Thank you!';
inputDom.style.textAlign = 'center';
// hide elements
doc.getElement('line').show(false);
this.show(false);
}
- Use CSS to make input field expand when typing:
.group {
border-radius: 10px;
padding: 10px 20px;
box-sizing: border-box;
height: auto !important;
}
.group div {
position: static !important;
width: auto !important;
height: auto !important;
}
.input {
min-height: 1.2em;
}
.group div.line {
height: 2px !important;
margin-bottom: 10px;
}
.submit p {
margin: 0;
}
Regards