Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blinking cursor not showing inside md editor when placed in overflows modal #618

Open
Aaron1111 opened this issue Feb 2, 2024 · 1 comment

Comments

@Aaron1111
Copy link

when my modals overflow-y is scroll, md editor not showing blinking cursor in focus but still able to type

when overflow is none cursor is there
Untitled

when overflow is scroll cursor not blinking
image

how to solve this?

@jaywcjlove
Copy link
Member

useEffect(() => {
if (document && overflow) {
if (fullscreen) {
// prevent scroll on fullscreen
document.body.style.overflow = 'hidden';
} else {
// get the original overflow only the first time
if (!originalOverflow.current) {
originalOverflow.current = window.getComputedStyle(document.body, null).overflow;
}
// reset to the original overflow
document.body.style.overflow = originalOverflow.current;
}
}
}, [fullscreen, originalOverflow, overflow]);

@Aaron1111 Maybe the overflow props can help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants