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

ag-Grid 19.1.1 sanitizes HTML in headers, causing slight breakage #2

Open
mestaritonttu opened this issue Nov 27, 2018 · 3 comments
Open

Comments

@mestaritonttu
Copy link

If you have a column without an explicitly set .headerName, starting from ag-Grid 19.1.1 it displays as
<span title="myColumn">myColumn</span>

The commit that caused this is ag-grid/ag-grid@3293b32

The thing needing rework in RockGrid.js is

return '<span title="' + hovertext + '">' + str + ' ' + icon + '</span>';

@BernhardBaumrock
Copy link
Owner

Hi @mestaritonttu thx for your report. could you please elaborate a little bit more what the problem is. RockGrid is using version 19.0.0 at the moment, so it should not be an issue.

If you have a suggestion for a fix I'd be thankful for a PR as I'm really busy currently.

@mestaritonttu
Copy link
Author

I know RG is using 19.0.0, but I wanted to warn you about the upcoming breakage :) To be clear, I verified that the commit I referenced causes the problem.

The problem is that the sanitizer makes the HTML plain text. You don't get a span element in the DOM, you get literally the markup shown in the column header. Looks like the icon will get the same bad treatment.

I don't have a suggestion off-hand. The fix would have to

  1. solve the hover text in a different way
  2. solve the icon insertion in a different way

@BernhardBaumrock
Copy link
Owner

Ok thanks! I hope I'll remember to take care of this when i upgrade aggrid...

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

No branches or pull requests

2 participants