@@ -58,6 +58,11 @@ const iconFadedOnNegative = `color-mix(in oklab, ${colorVars['--cl-color-negativ
5858// Both selectors are written out per cell rather than hoisted to a const: `@stylexjs/sort-keys`
5959// reads a computed key as its identifier name and fails the ordering.
6060//
61+ // `:active` also excludes `[data-pending]`, which `SubmitButton` sets while its action runs. That
62+ // button drops its pointer events, which is enough for the pointer, but a focused button still
63+ // takes `:active` from the keyboard — space and enter — and a pending button shouldn't flash a
64+ // pressed fill for a press it ignores.
65+ //
6166// `[data-open]` takes the pressed fill too, so a button acting as a disclosure trigger stays
6267// visibly engaged for as long as its surface is open. Disclosure primitives set it on the
6368// trigger (`popover-trigger.tsx` and friends); a plain button never carries it. It is excluded
@@ -188,7 +193,7 @@ export const variants = stylex.create({
188193 } ,
189194 backgroundColor : {
190195 default : colorVars [ '--cl-color-primary' ] ,
191- ':enabled:active' : primaryActive ,
196+ ':enabled:not([data-pending]): active' : primaryActive ,
192197 ':enabled[data-open]' : primaryActive ,
193198 '@media (hover: hover)' : {
194199 default : null ,
@@ -208,7 +213,7 @@ export const variants = stylex.create({
208213 } ,
209214 backgroundColor : {
210215 default : neutralStep0 ,
211- ':enabled:active' : neutralStep2 ,
216+ ':enabled:not([data-pending]): active' : neutralStep2 ,
212217 ':enabled[data-open]' : neutralStep2 ,
213218 '@media (hover: hover)' : {
214219 default : null ,
@@ -228,7 +233,7 @@ export const variants = stylex.create({
228233 } ,
229234 backgroundColor : {
230235 default : colorVars [ '--cl-color-negative' ] ,
231- ':enabled:active' : negativeActive ,
236+ ':enabled:not([data-pending]): active' : negativeActive ,
232237 ':enabled[data-open]' : negativeActive ,
233238 '@media (hover: hover)' : {
234239 default : null ,
@@ -253,7 +258,7 @@ export const variants = stylex.create({
253258 borderColor : colorVars [ '--cl-color-border' ] ,
254259 backgroundColor : {
255260 default : 'transparent' ,
256- ':enabled:active' : neutralStep1 ,
261+ ':enabled:not([data-pending]): active' : neutralStep1 ,
257262 ':enabled[data-open]' : neutralStep1 ,
258263 '@media (hover: hover)' : {
259264 default : null ,
@@ -274,7 +279,7 @@ export const variants = stylex.create({
274279 borderColor : colorVars [ '--cl-color-border' ] ,
275280 backgroundColor : {
276281 default : 'transparent' ,
277- ':enabled:active' : neutralStep1 ,
282+ ':enabled:not([data-pending]): active' : neutralStep1 ,
278283 ':enabled[data-open]' : neutralStep1 ,
279284 '@media (hover: hover)' : {
280285 default : null ,
@@ -295,7 +300,7 @@ export const variants = stylex.create({
295300 borderColor : colorVars [ '--cl-color-border' ] ,
296301 backgroundColor : {
297302 default : 'transparent' ,
298- ':enabled:active' : neutralStep1 ,
303+ ':enabled:not([data-pending]): active' : neutralStep1 ,
299304 ':enabled[data-open]' : neutralStep1 ,
300305 '@media (hover: hover)' : {
301306 default : null ,
@@ -316,7 +321,7 @@ export const variants = stylex.create({
316321 } ,
317322 backgroundColor : {
318323 default : 'transparent' ,
319- ':enabled:active' : neutralStep1 ,
324+ ':enabled:not([data-pending]): active' : neutralStep1 ,
320325 ':enabled[data-open]' : neutralStep1 ,
321326 '@media (hover: hover)' : {
322327 default : null ,
@@ -336,7 +341,7 @@ export const variants = stylex.create({
336341 } ,
337342 backgroundColor : {
338343 default : 'transparent' ,
339- ':enabled:active' : neutralStep1 ,
344+ ':enabled:not([data-pending]): active' : neutralStep1 ,
340345 ':enabled[data-open]' : neutralStep1 ,
341346 '@media (hover: hover)' : {
342347 default : null ,
@@ -358,7 +363,7 @@ export const variants = stylex.create({
358363 } ,
359364 backgroundColor : {
360365 default : 'transparent' ,
361- ':enabled:active' : `color-mix(in oklab, ${ colorVars [ '--cl-color-negative-faded' ] } , ${ colorVars [ '--cl-color-negative' ] } 8%)` ,
366+ ':enabled:not([data-pending]): active' : `color-mix(in oklab, ${ colorVars [ '--cl-color-negative-faded' ] } , ${ colorVars [ '--cl-color-negative' ] } 8%)` ,
362367 ':enabled[data-open]' : `color-mix(in oklab, ${ colorVars [ '--cl-color-negative-faded' ] } , ${ colorVars [ '--cl-color-negative' ] } 8%)` ,
363368 '@media (hover: hover)' : {
364369 default : null ,
0 commit comments