Skip to content

Conversation

jajugoguma
Copy link
Contributor

Please check if the PR fulfills these requirements

  • It's submitted to right branch according to our branching model
  • It's right issue type on title
  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)
  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)
  • It does not introduce a breaking change or has description for the breaking change

Description

  • Fixed an issue that did not work properly when the size of the color picker slider area was changed
  • The current test doesn't give the size of the element, So I just modified it to make the existing test work correctly.

As-Is

To-Be


Thank you for your contribution to TOAST UI product. 🎉 😘 ✨

Copy link
Contributor

@lja1018 lja1018 left a comment

Choose a reason for hiding this comment

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

리뷰 완료합니다.

src/js/slider.js Outdated
var sliderRects = this.sliderSvgElement.getClientRects()[0];

if (sliderRects) {
COLORSLIDER_POS_LIMIT_RANGE[1] = sliderRects.height - 10;
Copy link
Contributor

Choose a reason for hiding this comment

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

상수 값을 바꾸는 것보단 min, max 계산 시 처리하는게 나을 것 같아요.

src/js/slider.js Outdated
@@ -170,6 +172,11 @@ Slider.prototype.render = function(colorStr) {
Slider.prototype._moveColorSliderHandle = function(newLeft, newTop, silent) {
Copy link
Contributor

Choose a reason for hiding this comment

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

지금 마우스 움직일 때마다 getClientRects가 호출되는데 클릭 시작 시 혹은 드래그 시작 시에 1번만 호출되야할 것 같아요.

Choose a reason for hiding this comment

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

이름은 슬라이더가 움직일 때마다 호출되는 함수 같은데 전체 코드상 맞는지 확인 부탁드려요.

Copy link

@adhrinae adhrinae left a comment

Choose a reason for hiding this comment

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

리뷰 완료합니다. 이쪽 프로젝트는 잘 몰라도 의도는 잘 보이네요.

src/js/slider.js Outdated
var sliderRects = this.sliderSvgElement.getClientRects()[0];

if (sliderRects) {
COLORSLIDER_POS_LIMIT_RANGE[1] = sliderRects.height - 10;

Choose a reason for hiding this comment

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

기존에는 변하지 않을 값이라 생각해서 전부 대문자인 상수 변수로 처리한거같은데 이제 상황에 따라 동적으로 재할당되어야하는 상황이 되었으니 변수 네이밍 변경이 되었으면 좋겠네요. 나머지는 별 이견 없습니다.

Copy link

@jwlee1108 jwlee1108 left a comment

Choose a reason for hiding this comment

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

리뷰 완료합니다.

src/js/slider.js Outdated
@@ -170,6 +172,11 @@ Slider.prototype.render = function(colorStr) {
Slider.prototype._moveColorSliderHandle = function(newLeft, newTop, silent) {

Choose a reason for hiding this comment

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

이름은 슬라이더가 움직일 때마다 호출되는 함수 같은데 전체 코드상 맞는지 확인 부탁드려요.

chore: change constants to variables
chore: set sliders maximum pos when drag starts
Copy link

@adhrinae adhrinae left a comment

Choose a reason for hiding this comment

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

LGTM

그런데 이제와서 깨달은거지만, 컬러피커가 IE8+ 지원이라고 써있는데 querySelector를 쓰고 있네요. 이미 쓰고있었던거니까 IE8 지원은 안되고있는거라고 봐야할지도...

@jajugoguma
Copy link
Contributor Author

@adhrinae
querySelector와 같이 IE8에서 지원하지 않는 메서드 등을 제거해 IE8+를 올바르게 지원하도록 하는 작업은 별도 업무로 진행하겠습니다!

@jajugoguma jajugoguma merged commit 263cbb2 into master Jun 14, 2022
@jajugoguma jajugoguma deleted the fix/slider-for-different-size branch June 14, 2022 02:06
@adhrinae
Copy link

@jajugoguma
오히려 이건 확인 후에 IE9+으로 문서를 바꿔야하는거 아닌가 싶어요 ㅎㅎ

@jajugoguma
Copy link
Contributor Author

@adhrinae
아 그러면 랩장님도 포함해서 회의를 한 번 해야겠군요... ㅜㅜ

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

Successfully merging this pull request may close these issues.

4 participants