Post settings text fields are cleared when the new post settings panel is opened.
When the value is set to blank by JavaScript, the text field are not automatically marked as such by removing the is-dirty class. This class must be artificially removed:
const new_post = function () {
var title = document.querySelector("#new-post-title-input");
title.value = "";
title.parentNode.classList.remove("is-dirty");
var note = document.querySelector("#new-post-note-input");
note.value = "";
note.parentNode.classList.remove("is-dirty");
document.querySelector("#new-post-panel").className = "visible";
}
Note: Post settings cannot be set to "", because MDL still detects that the input field contains text, so the text field title is displayed above the field.
Post settings text fields are cleared when the new post settings panel is opened.
When the value is set to blank by JavaScript, the text field are not automatically marked as such by removing the
is-dirty
class. This class must be artificially removed:Note: Post settings cannot be set to
""
, because MDL still detects that the input field contains text, so the text field title is displayed above the field.Also tested:
.removeAttribute("value");
.reset();
.val("");
.innerHTML = "";