3
0
Fork 0

fix: ensure grid action icon+label do not wrap

This commit is contained in:
Lance Edgar 2026-01-06 19:46:19 -06:00
parent 2e8a602343
commit 26ebfcab09
2 changed files with 5 additions and 2 deletions

View file

@ -2604,9 +2604,10 @@ class GridAction: # pylint: disable=too-many-instance-attributes
"""
html = [
self.render_icon(),
HTML.literal(" "),
self.render_label(),
]
return HTML.literal(" ").join(html)
return HTML.tag("span", c=html, style="white-space: nowrap;")
def render_icon(self):
"""

View file

@ -2051,7 +2051,9 @@ class TestGridAction(TestCase):
action, render_icon=lambda: "ICON", render_label=lambda: "LABEL"
):
html = action.render_icon_and_label()
self.assertEqual("ICON LABEL", html)
self.assertTrue(html.startswith("<span "))
self.assertIn("ICON", html)
self.assertIn("LABEL", html)
def test_get_url(self):
obj = {"foo": "bar"}