Skip to content

Commit

Permalink
Do not add the extra space to placeholder searchText elements as they…
Browse files Browse the repository at this point in the history
… are appended
  • Loading branch information
jonathonherbert committed Jul 19, 2024
1 parent 3831168 commit 1ea6ac0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion prosemirror-client/src/cqlInput/CqlInput.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ test("accepts the given value when a popover appears", async () => {
await selectPopoverOption(container, "Tag");
await findByShadowText(container, "tag");

expect(valueContainer.value).toBe("example +tag: ");
expect(valueContainer.value).toBe("example +tag: ");
});

test("ctrl-a moves the caret to the beginning of the input", async () => {
Expand Down
2 changes: 1 addition & 1 deletion prosemirror-client/src/cqlInput/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const createEditor = ({
const tr = view.state.tr;
tr.insert(
view.state.doc.nodeSize - 2,
schema.nodes.searchText.create(undefined, schema.text(" "))
schema.nodes.searchText.create(undefined)
);
view.updateState(view.state.apply(tr));
}
Expand Down
3 changes: 2 additions & 1 deletion prosemirror-client/src/cqlInput/fixtures/TestCqlService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ const resultFixtures: Record<string, CqlResult> = {
"example ": createTextResponse("example "),
"<example ": createTextResponse("<example "),
"example >": createTextResponse("example >"),
"<example >": createTextResponse("example >"),
"example +": example_plus,
"example +: ": example_pluscolon,
"example +tag: ": example_plustagcolon,
"example +tag: ": example_plustagcolon,
"example +tag:tags-are-magic": example_tags_are_magic,
"example +tag:tags-are-magic ": example_tags_are_magic,
"example +tag:tags-are-magic ": example_tags_are_magic,
Expand Down

0 comments on commit 1ea6ac0

Please sign in to comment.