Skip to content

Incorrect OOB swapping of second table in a two tables page #3203

@langdiana

Description

@langdiana

I have two tables, I swap regularly the tbody of the first one and OOB swap the whole second table.
After swap the inner html of the second table (with the new content) is included in the first table and the second table is not touched. Any additional swap will add the inner html of the second table again into the first table.
OOB swapping works normal if I use something else instead of second table.

Additional info (and I think here is the problem): the trigger for swap is inside the first table, more exactly in an input field in one header. I think your function makeFragment is not working correctly in this case.

Before swap:

<table id="myTable">
  <thead> ...</thead>
  <tbody> ...</tbody>
</table>

<table id="myOobTable">
  <thead> ...</thead>
  <tbody> ...</tbody>
</table>

After first swap:

<table id="myTable">
  <thead> ...</thead>
  <tbody> ...</tbody> // new content
  <thead> ...</thead> // thead from myOobTable, new content
  <tbody> ...</tbody> //tbody from myOobTable, new content
</table>

<table id="myOobTable"> // same as before swap
  <thead> ...</thead>
  <tbody> ...</tbody>
</table>

After second swap:

<table id="myTable">
  <thead> ...</thead>
  <tbody> ...</tbody> // new content
  <thead> ...</thead> // thead from myOobTable, new content
  <tbody> ...</tbody> //tbody from myOobTable, new content
  <thead> ...</thead> // thead from myOobTable, content from first swap 
  <tbody> ...</tbody> //tbody from myOobTable, content from first swap
</table>

<table id="myOobTable"> // same as before swap
  <thead> ...</thead>
  <tbody> ...</tbody>
</table>

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions