Skip to content

Commit

Permalink
fix: should restrict elemenent within node container when use html()
Browse files Browse the repository at this point in the history
  • Loading branch information
bubkoo committed Mar 25, 2020
1 parent f9758b1 commit 59a39b6
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions packages/x6/src/research/attr/define.ts
Expand Up @@ -7,8 +7,17 @@ import { NumberExt, JSONObject, StringExt, ObjectExt } from '../../util'
export namespace Attr {
export type SimpleAttrValue = string | number | null | undefined
export type SimpleAttrs = { [name: string]: SimpleAttrValue }
export type ComplexAttrValue = string | number | JSONObject | null | undefined

export type ComplexAttrValue =
| string
| number
| boolean
| JSONObject
| null
| undefined

export type ComplexAttrs = { [name: string]: ComplexAttrValue }

export type CellAttrs = { [selector: string]: ComplexAttrs }
}

Expand Down Expand Up @@ -53,7 +62,7 @@ export namespace Attr {
export type PositionFunction = (
val: ComplexAttrValue,
options: Options,
) => Point | Point.PointLike
) => Point | Point.PointLike | undefined

export interface PositionDefinition extends Qualify {
/**
Expand Down Expand Up @@ -356,7 +365,10 @@ export namespace Attr {

html: {
set(html, { view, node }) {
view.$(node).html(`${html}`)
view
.$(view.container)
.find(node)
.html(`${html}`)
},
},

Expand Down

0 comments on commit 59a39b6

Please sign in to comment.