Skip to content

Commit

Permalink
Fix wrong history index bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Skalakid committed May 16, 2024
1 parent 08d12ae commit fca071a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/MarkdownTextInput.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ const MarkdownTextInput = React.forwardRef<TextInput, MarkdownTextInputProps>(
const processedMarkdownStyle = useMemo(() => {
const newMarkdownStyle = processMarkdownStyle(markdownStyle);
if (divRef.current) {
parseText(divRef.current, divRef.current.innerText, newMarkdownStyle);
parseText(divRef.current, divRef.current.innerText, newMarkdownStyle, null, false);
}
return newMarkdownStyle;
}, [markdownStyle, parseText]);
Expand Down
2 changes: 1 addition & 1 deletion src/web/InputHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default class InputHistory {
}

add(text: string, cursorPosition: number): void {
if (this.historyIndex > 0 && this.items.length > 0) {
if (this.items.length > 0) {
const currentItem = this.items[this.historyIndex];
if (currentItem && text === currentItem.text) {
return;
Expand Down

0 comments on commit fca071a

Please sign in to comment.