-
Notifications
You must be signed in to change notification settings - Fork 396
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
fix: editors with drop-down layer to follow scrolling #1542
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
리뷰 완료합니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
리뷰 완료합니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
늦었지만 리뷰 완료입니다!
return start <= value && value <= end; | ||
} | ||
|
||
export function pixelToNumber(pixelString: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
string
대신 템플릿 리터럴 타입쓰면 될 것 같은데..생각해보니 ts 버전이 낮아 안되겠네요..
if (this.editor?.moveDropdownLayer) { | ||
this.editor.moveDropdownLayer({ | ||
bodyHeight, | ||
bodyWidth, | ||
bodyScrollTop, | ||
bodyScrollLeft, | ||
headerHeight, | ||
leftSideWidth, | ||
...this.initBodyScroll, | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
엔터키로 편집 종료하거나 탭키로 에디팅 레이어 이동할 때는 문제 없나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
키보드 동작이 정상적으로 동작하지 않아 원인을 알아보니, visibility: hidden;
이나 display: none;
처럼 DOM 상에 보여지지 않는 요소에는 포커스를 줄 수 없다는 것을 알았습니다.
실제로 에디팅 중에 스크롤을 이용해 에디터를 보이지 않게 설정하면 editingLayer`가 포커스를 잃는 것을 확인했습니다.
이를 해결하기 위해서는 에디터를 DOM 상에서 보이지만, 실제로는 보이지 않게 해야했습니다. 이를 위해 드롭다운 레이어의top
과 left
를 0
으로 설정해 그리드 바디 좌측 상단에 위치하도록 하고 z-index
를 -100
을 할당해 그리드 셀 아래로 숨겨지도록 했습니다.
결과적으로 보여지는 화면은 같지만, 키보드 동작은 정상적으로 수행할 수 있었습니다. 이런 방법을 이용해도 괜찮을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jajugoguma
stack context나 위치 자체를 바꾸기 보다 opacity
로 제어하는게 제일 나을 것 같은데 어떤가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check if the PR fulfills these requirements
fix #xxx[,#xxx]
, where "xxx" is the issue number)Description
As-Is
To-Be
Thank you for your contribution to TOAST UI product. 🎉 😘 ✨