fix: ensure grid action icon+label do not wrap
This commit is contained in:
parent
2e8a602343
commit
26ebfcab09
2 changed files with 5 additions and 2 deletions
|
|
@ -2604,9 +2604,10 @@ class GridAction: # pylint: disable=too-many-instance-attributes
|
||||||
"""
|
"""
|
||||||
html = [
|
html = [
|
||||||
self.render_icon(),
|
self.render_icon(),
|
||||||
|
HTML.literal(" "),
|
||||||
self.render_label(),
|
self.render_label(),
|
||||||
]
|
]
|
||||||
return HTML.literal(" ").join(html)
|
return HTML.tag("span", c=html, style="white-space: nowrap;")
|
||||||
|
|
||||||
def render_icon(self):
|
def render_icon(self):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -2051,7 +2051,9 @@ class TestGridAction(TestCase):
|
||||||
action, render_icon=lambda: "ICON", render_label=lambda: "LABEL"
|
action, render_icon=lambda: "ICON", render_label=lambda: "LABEL"
|
||||||
):
|
):
|
||||||
html = action.render_icon_and_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):
|
def test_get_url(self):
|
||||||
obj = {"foo": "bar"}
|
obj = {"foo": "bar"}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue