Fix label display issue when label contains SVG image #491 #493
No reviewers
Labels
No labels
Android-shell
bug
enhancement
Help Wanted
high-priority
huge
low-priority
Meta
NLNet
OSOC21:Cycling-OVL
Performance
question
search-ui-enhancement
Studio
Tailwind
Themes
UI
upstream-issue
usertest
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: MapComplete/MapComplete#493
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix-answer-with-image-style-#491"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is based on top of https://github.com/pietervdvn/MapComplete/pull/485 to use the JIT mode.
Commits
Replace inline style with TW classes
29e7fea
Refactoring: Small html/variables changes
43618fe
Refactoring: Random spaces / newline changes
b8dc106
Checkboxes: Margin only bottom …
9889b0d
We only need it to the bottom and left/right mess with w-full in this css-setup.
TW Classes instead of inline; no pointer event "all" …
821c976
The way I read https://developer.mozilla.org/de/docs/Web/CSS/pointer-events,
pointer-events: all
is a special SVG thing and what we want here, is what TW provides withpointer-events-none
https://tailwindcss.com/docs/pointer-events so that event pass through.Fix #491 with custom HTML/Classes inside translations …
![image](https://user-images.githubusercontent.com/111561/135521083-629713cb-535b-4043-a5ed-7627211ea2ba.png)
8e040a8
This is not the fixed I hoped for, but the JS generates so many empty
<span>
tags that I cannot get rid of, that it is not possible to style this "from the outside", which is unfortunate.==> Follow up question: Is there a way to get rid of those empty spans?
Screenshots
Fixes #491
Really cool again!
Some 'spans' are generated by Combine elements, I should optimize those one day.
While you were working on it, I also encapsulated those answers in a div with flex + flex col, so I merged both changes.
@pietervdvn I just thought about another approach that would make this setup a bit cleaner IMO:
Would it be possible to split the translations in something like …
Now…
Then…
(Or does it have to be like this?)
This would allow tho move the flex-divs inside code an only apply then if
optImgage
is present.One could also use
optImagePath
to move even more HTML to the code, but that would disallow other possible "workarounds" like different image sizes and such.However, ATM I don't understand enough of the code to know how to build this…