MCPcopy
hub / github.com/basecamp/trix / simulateKeypress

Function simulateKeypress

src/test/test_helpers/input_helpers.js:270–282  ·  view source on GitHub ↗
(keyName)

Source from the content-addressed store, hash-verified

268}
269
270const simulateKeypress = async (keyName) => {
271 switch (keyName) {
272 case "backspace":
273 await deleteInDirection("left")
274 break
275 case "delete":
276 await deleteInDirection("right")
277 break
278 case "return":
279 triggerInputEvent(document.activeElement, "beforeinput", { inputType: "insertParagraph" })
280 break
281 }
282}
283
284const deleteInDirection = async (direction) => {
285 if (selectionIsCollapsed()) {

Callers 1

pressKeyFunction · 0.85

Calls 2

deleteInDirectionFunction · 0.85
triggerInputEventFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…