fix: don't bind text to container if already present (#4946)

* fix: don't bind text to container if already present

* Add specs and update condition
This commit is contained in:
Aakansha Doshi 2022-03-22 15:32:49 +05:30 committed by GitHub
parent e29d3fc5e6
commit 8e447b4c32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 48 additions and 2 deletions

View file

@ -2215,7 +2215,11 @@ class App extends React.Component<AppProps, AppState> {
(shouldBind || parentCenterPosition)
) {
container = getTextBindableContainerAtPosition(
this.scene.getElements().filter((ele) => !isTextElement(ele)),
this.scene
.getElements()
.filter(
(ele) => isTextBindableContainer(ele) && !getBoundTextElement(ele),
),
sceneX,
sceneY,
);