Skip to content

Commit

Permalink
fixed types
Browse files Browse the repository at this point in the history
  • Loading branch information
LiveDuo committed Nov 5, 2023
1 parent 450c7bb commit daba6cf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/client/vanilla/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,11 @@ function Editor({ standaloneServer = false }) {
e.preventDefault()

const components = getComponents()
components.forEach((c: any) => {
components.forEach((c: HTMLDivElement) => {
if (isEventOnElement(c, e)) {
const isTopHalf = isElementTopHalf(c, e)
c.style[`border-${isTopHalf ? 'top' : 'bottom'}`] = '4px solid cornflowerblue'
c.style[`border-${!isTopHalf ? 'top' : 'bottom'}`] = ''
c.setAttribute(`border-${isTopHalf ? 'top' : 'bottom'}`, '4px solid cornflowerblue')
c.setAttribute(`border-${!isTopHalf ? 'top' : 'bottom'}`, '')

if (!c.isEqualNode(hoveredComponent)) {
setHoveredComponent(c)
Expand All @@ -279,9 +279,9 @@ function Editor({ standaloneServer = false }) {
setHoveredComponent(null)

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

Expand Down

0 comments on commit daba6cf

Please sign in to comment.