Skip to content

Commit

Permalink
fixed borders
Browse files Browse the repository at this point in the history
  • Loading branch information
LiveDuo committed Nov 5, 2023
1 parent daba6cf commit c683775
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/client/vanilla/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,9 @@ function Editor({ standaloneServer = false }) {
components.forEach((c: HTMLDivElement) => {
if (isEventOnElement(c, e)) {
const isTopHalf = isElementTopHalf(c, e)
c.setAttribute(`border-${isTopHalf ? 'top' : 'bottom'}`, '4px solid cornflowerblue')
c.setAttribute(`border-${!isTopHalf ? 'top' : 'bottom'}`, '')

c.style.setProperty(`border-${isTopHalf ? 'top' : 'bottom'}`, '4px solid cornflowerblue')
c.style.setProperty(`border-${!isTopHalf ? 'top' : 'bottom'}`, '')

if (!c.isEqualNode(hoveredComponent)) {
setHoveredComponent(c)
Expand All @@ -280,8 +281,8 @@ function Editor({ standaloneServer = false }) {

const components = getComponents()
components.forEach((c: HTMLDivElement) => {
c.setAttribute('border-top', '')
c.setAttribute('border-bottom', '')
c.style.setProperty('border-top', '')
c.style.setProperty('border-bottom', '')
})
}

Expand Down

0 comments on commit c683775

Please sign in to comment.