-
-
Notifications
You must be signed in to change notification settings - Fork 191
Description
Describe the bug
When I use floorplan.text_set with multi line text (eg. text: 'Artist\nTrack\nInfo') and then set the element with a single line (eg. text: 'Artist Track Info') the extra lines remain displayed. It seems as if HA-Floorplan is simply overwriting the first <tspan> instead of the whole <text> block. The behavior is the same if after setting the element with a multi line text I then set it with an empty text (eg. text: '')
To Reproduce
Steps to reproduce the behavior:
- Set a text element with a multi line text.
- Set that same element with a single line or empty text.
Expected behavior
I would expect the extra <tspan> blocks to be removed when over writing an element.
Screenshots
Multi Line Text, input_text.testone is set to Album\nTrack\nInfo

Then change input_text.testone to single line Album Track Info triggering state_action update

Desktop (please complete the following information):
- OS: Win 11
- Browser: Chrome, Edge, Iridium
- Version Latest
Smartphone (please complete the following information):
N/A
Share configuration
Please share:
YAML(IMPORTANT!)
##Experiment##
- entity: input_text.testone
state_action:
- service: floorplan.text_set
service_data:
element: input_text.next_track
text: '${entity.state}'CSS
tspan {
fill: rgb(0, 0, 0) !important;
font-family: Georgia, serif !important;
font-variant: small-caps !important;
stroke: rgba(222, 184, 135, 1);
stroke-width: 0.05px !important;
}- SVG-file (IMPORTANT!) (Use gofile.io, or something simular)
Text element created in Inkscape
If you create a issue without a SVG example, including the required YAML and CSS to reproduce the issue, it's likely what your issue will be closed, or marked as unresolvable, as it's lacking the proper amount of details. Thank you for understanding the situation.
Additional context
I use multi line texts to break up very long song titles in a custom HA card for Music Assistant to make better use of space. As a Jam Band and Live Music fan song titles often comprise of many song titles together which becomes very long (eg. Scarlet Begonias>Fire on the Mountain>Space>Drums>Fire on the Mountain). The text updates with each new track and I end up with a mess of current and leftover song title bits that destroys the user friendliness of the interface.
For this issue I created a dummy input_text helper and used it to trigger the update on state change to make it easier to show the issue.