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

TableSort and new Series table #13

Open
unnecessarydave opened this issue Dec 5, 2024 · 2 comments
Open

TableSort and new Series table #13

unnecessarydave opened this issue Dec 5, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@unnecessarydave
Copy link
Collaborator

TableSort has multiple issues with the new Series table:

  • clicking to sort a column displays a tsunami of tooltips
  • cells are line wrapped when an Invite link is displayed during series break
@unnecessarydave unnecessarydave added the bug Something isn't working label Dec 5, 2024
@unnecessarydave unnecessarydave added the newdesign Affects new design (not classic) only label Dec 21, 2024
@rferromoreno
Copy link

  • clicking to sort a column displays a tsunami of tooltips

Had been trying to debug this, seems it's because the cloneElement logic and probably the hattrick-tooltip component mounting logic, or something with, Angular DOM manipulation. Maybe we should sync with HT Devs to fix this one. Or we could just manipulate the DOM by deleting duplicated tooltips and adding the hidden attribute to each of the elements, but honestly I do not like that solution

@unnecessarydave
Copy link
Collaborator Author

unnecessarydave commented Jan 7, 2025

Thanks for taking the time to look at this.

So when we cloneElement it runs the constructor for hattrick's custom <hattrick-tooltip> element and that adds the duplicate <div id="tooltip"> maybe? Or Angular, as you say, which I assume has MutationObservers doing who knows what.

As per your comment I tried this out as a test

File: table-sort.js
122: 				// rows to be sorted
123: 				var rows = [];
124: 				for (let i = sortStart + 1; i < sortEnd; ++i) {
125: 					let row = table.rows[i];
126: 					let tooltips = row.querySelectorAll('#tooltip');
127: 					if (tooltips.length > 0)
128: 						tooltips.forEach(tt => tt.remove());
129: 					rows.push(Foxtrick.cloneElement(row, true));
130: 				}

On the surface this does work, but it doesn't totally solve the problem. With each successive click to sort it gets slower and slower. Possibly because Angular or something else still has references to all the deleted elements???

@unnecessarydave unnecessarydave removed the newdesign Affects new design (not classic) only label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants