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: context menu goes out of viewport #1682
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.
리뷰 μλ£ν©λλ€.
cy.isInViewport(`.${cls('context-menu')}`); | ||
}); | ||
|
||
it('should change displaying direction of sub menus when there is no spaces to dispaly sub context menu', () => { |
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.
it('should change displaying direction of sub menus when there is no spaces to dispaly sub context menu', () => { | |
it('should change displaying direction of submenus when there is no space to display sub context menu', () => { |
@@ -8,3 +8,4 @@ export const DISABLED_PRIORITY_CELL = 'CELL'; | |||
export const DISABLED_PRIORITY_ROW = 'ROW'; | |||
export const DISABLED_PRIORITY_COLUMN = 'COLUMN'; | |||
export const HORIZONTAL_PADDING_OF_CELL = 10; | |||
export const DEFATULT_SUB_CONTEXT_MENU_TOP = -6; |
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.
export const DEFATULT_SUB_CONTEXT_MENU_TOP = -6; | |
export const DEFAULT_SUB_CONTEXT_MENU_TOP = -6; |
return { computedTop, computedLeft }; | ||
} | ||
|
||
private adjustPosition() { |
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.
gridμ 컨벀μ
μ μ λͺ¨λ₯΄κ² μΌλ, positionμ μ€μ¬μ pos
λΌκ³ λ§μ΄ μ°λλ° μ¬κΈ°μλ Position
μ΄λΌκ³ λμ΄ μλ€μ. μκ΄μμ΄ λλ€ μ°μΈλ€λ©΄ μμ νμ§ μμΌμ
λ λ©λλ€!
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.
this.props.pos
λ₯Ό 보λ pos
λ‘ μ€μ΄λλ° ννμ
λλ€!
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.
λͺ¨μμλ§ λ΄μλ getComputedPos
λ adjustPos
μ λ‘컬 ν¨μλ‘λ§ μμ΄λ λκ±°λ κ΅³μ΄ λλ νμκ° μμ΄λ³΄μ΄λ€μ.
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 { computedTop, computedLeft }; | ||
} | ||
|
||
private adjustPosition() { |
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.
this.props.pos
λ₯Ό 보λ pos
λ‘ μ€μ΄λλ° ννμ
λλ€!
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.
리뷰 μλ£ν©λλ€.
@@ -7,6 +7,22 @@ before(() => { | |||
cy.visit('/dist'); | |||
}); | |||
|
|||
function createGridWithManyData() { |
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.
λ³΄ν΅ DataλΌλ λ¨μ΄μλ LargeλΌλ μμμ΄κ° λ§μ΄ λΆμ΅λλ€.
large dataset, large data volume λ±λ±
const height = 600; | ||
const width = 800; |
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.
νΉμ μ΄ κ° Cypress μ€μ κ° νκ²½λ³μκ°μκ±°λ‘ κ°μ Έμ¬ μ μλμ? λ§μ½μ λ·°ν¬νΈλ₯Ό λ€μνκ² λλ €λ³Έλ€λμ§ νλ μμΌλ‘ ν μ€νΈ λ²μκ° νμ₯λλ©΄ μ΄ μ»€λ§¨λλ μ°κΈ° μ΄λ €μμ§λλ€.
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.
κ·Έλ¦¬κ³ κΆκ·Ήμ μΌλ‘λ μ΄λ° λ°©μμΌλ‘ κ³μ°μ νλκ² λ λ§μκ±°κ°μλ° νλ² μ€νν΄λ³΄μ μ.
function isInViewport(element) {
const rect = element.getBoundingClientRect();
return (
rect.top >= 0 &&
rect.left >= 0 &&
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
rect.right <= (window.innerWidth || document.documentElement.clientWidth)
);
}
return { computedTop, computedLeft }; | ||
} | ||
|
||
private adjustPosition() { |
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.
λͺ¨μμλ§ λ΄μλ getComputedPos
λ adjustPos
μ λ‘컬 ν¨μλ‘λ§ μμ΄λ λκ±°λ κ΅³μ΄ λλ νμκ° μμ΄λ³΄μ΄λ€μ.
|
||
right -= parentOffsetLeft; | ||
bottom -= parentOffsetTop; | ||
} while (!includes(element.className.split(' '), cls('container'))); |
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.
element.classList.contains
λ₯Ό μ μ°λ μ΄μ λ IE9 μ§μ λλ¬ΈμΌκΉμ?
μΌλ¨ μ§κΈμ λΉλ νκ²½μΌλ‘λ ν΄λ¦¬νμ΄ μλ€μ΄κ°κ³ μκΈ° λλ¬Έμ μμ½μ§λ§ μ΄μ© μ μκΈ΄ νλ€μ.
μ°¨λΌλ¦¬ κ·Έλ λ€λ©΄ μΌμΌμ΄ classNameμ λ°°μ΄λ‘ μͺΌκ°μ μνμν€λκ±°λ³΄λ€ μ κ·ννμμ νμ©νλκ² μ’ λ λμ μλ μκ² μ΄μ.
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. π π β¨