Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyassBZ authored Sep 14, 2024
2 parents d1255a7 + 76cf919 commit 2b013dc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Mentions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ const InternalMentions = forwardRef<MentionsRef, MentionsProps>(
key === nextMeasurePrefix ||
key === 'Shift' ||
key === 'AltGraph' ||

mergedMeasuring ||
(nextMeasureText !== mergedMeasureText && matchOption)
) {
Expand Down
20 changes: 20 additions & 0 deletions tests/FullProcess.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,24 @@ describe('Full Process', () => {

expectMeasuring(container, false);
});

it('AltGr + à startMeasure', () => {
const onChange = jest.fn();
const { container } = createMentions({ onChange });
simulateInput(container, '@');

// AZERTY Keyboards (AltGr + à)
fireEvent.keyUp(container.querySelector('textarea'), {
keyCode: KeyCode.ALT,
which: KeyCode.ALT,
});
expectMeasuring(container);

fireEvent.keyDown(container.querySelector('textarea'), {
keyCode: KeyCode.ENTER,
which: KeyCode.ENTER,
});

expect(onChange).toBeCalledWith('@bamboo ');
});
});

0 comments on commit 2b013dc

Please sign in to comment.