You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use feature state expression to change text-color while also using format inside text-field expression to change color.
Toggle feature state on and then off.
Original issue (not resolved by mapbox from 2020, but I just faced the same here): mapbox/mapbox-gl-js#9711
Link to Demonstration
Expected Behavior
It should reevaluate all color logic. Maybe add text value 'inherit' to 'text-color' in paint so that it can use those values rather than required fallback color (in my case #000000)
Actual Behavior
After changing feature-state expression 'format' colors are ignored, instead it uses default fallback color
paint: {'text-color': ["case",["boolean",["feature-state","selected"],false],"#6a050a",'#000000'// gets back to black instead using 'format' logic from 'layout']}```
howeveronstartiffeature-stateisnotchanged,colorsdisplayproperly
The text was updated successfully, but these errors were encountered:
Thanks for taking the time to open this issue.
There are a lot of bugs with feature state unfortunately...
Can you please create a minimal reproduction using jsbin or a similar service?
maplibre-gl-js version: 4.7.1
browser: firefox
Steps to Trigger Behavior
Link to Demonstration
Expected Behavior
It should reevaluate all color logic. Maybe add text value 'inherit' to 'text-color' in paint so that it can use those values rather than required fallback color (in my case #000000)
Actual Behavior
After changing feature-state expression 'format' colors are ignored, instead it uses default fallback color
The text was updated successfully, but these errors were encountered: