fill-color-transition not honored on first 1-2 transitions, if the fill-color is an expression
Author: birkskyumCreated Nov 1, 2024Updated Sep 28, 2026
LabelsbugPR is more than welcomed
Repro here: https://codepen.io/birkskyum-1471370946/pen/NWQzdZG
changing the color will be instant on 1-2 first clicks, despite a "fill-color-transition": { "duration": 2000 },
This issue go away by replacing the fill-color expression:
"fill-color": ["match",["get","ADM0_A3"],["ATA","GRL"],"#FFFFFF","#EAB38F"]
With a string color:
"fill-color": "green"
Demo
The video show that the first time i click on the expression fill-color, the transition is instant, and then it's normal for subsequent clicks.
Changing the fill-color to "green" makes the first clock behave as expected as well
https://github.com/user-attachments/assets/49154673-ab3b-4b0a-8d00-eafb5fc509cc
Source: maplibre/maplibre-gl-js