Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/utils/caret.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export function checkContenteditableSliceForEmptiness(contenteditable: HTMLEleme
* @param input - input where caret should be checked
*/
export function isCaretAtStartOfInput(input: HTMLElement): boolean {
const firstNode = $.getDeepestNode(input);
const firstNode = $.isNativeInput(input) ? input : $.getDeepestNode(input);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest to update getDeepestNode instead. It already contains a logic that will return a passed node, but seems like node[child] statement does not cover this case

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for pointing it out.
I think you are right too.

Fixed in 8cec5c9.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@neSpecc
Please re-review.


if (firstNode === null || $.isEmpty(input)) {
return true;
Expand Down