Skip to content
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

Table cells are not removed from view when removing the table #22

Open
velara3 opened this issue Jun 4, 2014 · 6 comments
Open

Table cells are not removed from view when removing the table #22

velara3 opened this issue Jun 4, 2014 · 6 comments
Assignees
Labels

Comments

@velara3
Copy link
Collaborator

velara3 commented Jun 4, 2014

The cells are not removed from view when removing the table.

Steps to Reproduce

  1. Click Add Table
  2. Click Remove Table

Expected Results
Table is removed from text flow and no longer visible

Actual Results
Table is removed from the text flow object but the visual elements are still visible

@velara3 velara3 added the bug label Jun 4, 2014
@velara3
Copy link
Collaborator Author

velara3 commented Jun 6, 2014

This seems like it may require changes in replaceChildren. Possible fix is to add a check to see if the element is a Table and if so call table.removeAllRowsWithContent().

@velara3 velara3 assigned Harbs and unassigned Harbs Jun 6, 2014
@Harbs
Copy link
Owner

Harbs commented Jun 6, 2014

replaceChildren() is designed so you can respond to it without modifying the function. replaceChildren() calls modelChanged() and passes in either ModelChange.ELEMENT_ADDED or ModelChange.ELEMENT_REMOVAL. modelChanged() is designed to be overridden by the subclasses to handle any additional class-specific cleanup necessary.

@velara3
Copy link
Collaborator Author

velara3 commented Jun 6, 2014

I'll check into it. In my tests it seems the modelChanged() is getting called when TableCellElements are added but not when the Table is removed.

@Harbs
Copy link
Owner

Harbs commented Jun 6, 2014

That makes sense. The function is called on the parent of the elements that are added/removed.

@velara3
Copy link
Collaborator Author

velara3 commented Jun 6, 2014

We may want to add an override so that the element itself has a chance to clean up. Maybe, element.removed() or element.modelChanged(ModelChange.REMOVED).

@velara3
Copy link
Collaborator Author

velara3 commented Jun 22, 2014

With the last update the shapes are now removed when the text flow is cleared but when the table element is removed by removeChild() an error is thrown.

ArgumentError: Child to remove not found
at flashx.textLayout.elements::FlowGroupElement/removeChild()[930]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants