diff --git a/README.md b/README.md index 0133f94a3..4dbca2330 100644 --- a/README.md +++ b/README.md @@ -49,36 +49,68 @@ document.addEventListener("trix-before-initialize", () => { ## Creating an Editor -Place an empty `` tag on the page. Trix will automatically insert a separate `` before the editor. +Place an empty `` tag on the page. If the `` element is rendered with a `[toolbar]` attribute that references the element by its `[id]`, it will treat that element as its toolbar: + +```html + + + +``` + +Otherwise, Trix will automatically insert a separate `` before the editor. Like an HTML ` diff --git a/src/test/system/custom_element_test.js b/src/test/system/custom_element_test.js index 2e77e3fc4..8d03d60e2 100644 --- a/src/test/system/custom_element_test.js +++ b/src/test/system/custom_element_test.js @@ -442,7 +442,7 @@ testGroup("Custom element API", { template: "editor_empty" }, () => { test("editor resets to its original value on form reset", async () => { const element = getEditorElement() - const { form } = element.inputElement + const { form } = element await typeCharacters("hello") form.reset() @@ -451,7 +451,7 @@ testGroup("Custom element API", { template: "editor_empty" }, () => { test("editor resets to last-set value on form reset", async () => { const element = getEditorElement() - const { form } = element.inputElement + const { form } = element element.value = "hi" await typeCharacters("hello") @@ -461,7 +461,7 @@ testGroup("Custom element API", { template: "editor_empty" }, () => { test("editor respects preventDefault on form reset", async () => { const element = getEditorElement() - const { form } = element.inputElement + const { form } = element const preventDefault = (event) => event.preventDefault() await typeCharacters("hello") @@ -473,27 +473,24 @@ testGroup("Custom element API", { template: "editor_empty" }, () => { }) }) -testGroup("