Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix: disabled Checkbox label cursor is no longer a pointer",
"packageName": "@fluentui/react-checkbox",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ const useInputStyles = makeStyles({
cursor: 'default',

[`& ~ .${checkboxClassNames.label}`]: {
cursor: 'default',
color: tokens.colorNeutralForegroundDisabled,
'@media (forced-colors: active)': {
color: 'GrayText',
Expand Down Expand Up @@ -156,13 +157,6 @@ const useInputStyles = makeStyles({
large: {
width: `calc(${indicatorSizeLarge} + 2 * ${tokens.spacingHorizontalS})`,
},

labelMedium: {
width: `calc(${indicatorSizeMedium} + ${tokens.spacingHorizontalS})`,
},
labelLarge: {
width: `calc(${indicatorSizeLarge} + ${tokens.spacingHorizontalS})`,
},
});

const useIndicatorStyles = makeStyles({
Expand All @@ -183,13 +177,6 @@ const useIndicatorStyles = makeStyles({
pointerEvents: 'none',
},

labelBefore: {
marginLeft: 0,
},
labelAfter: {
marginRight: 0,
},

medium: {
fontSize: '12px',
height: indicatorSizeMedium,
Expand All @@ -216,10 +203,10 @@ const useLabelStyles = makeStyles({
},

before: {
paddingRight: tokens.spacingHorizontalM,
paddingRight: tokens.spacingHorizontalXS,
},
after: {
paddingLeft: tokens.spacingHorizontalM,
paddingLeft: tokens.spacingHorizontalXS,
},

// Use a (negative) margin to account for the difference between the indicator's height and the label's line height.
Expand All @@ -241,15 +228,13 @@ export const useCheckboxStyles_unstable = (state: CheckboxState): CheckboxState
const rootStyles = useRootStyles();
state.root.className = mergeClasses(checkboxClassNames.root, rootStyles.base, state.root.className);

const { label, labelPosition, shape, size } = state;
const { labelPosition, shape, size } = state;

const inputStyles = useInputStyles();
state.input.className = mergeClasses(
checkboxClassNames.input,
inputStyles.base,
inputStyles[size],
label && size === 'medium' && inputStyles.labelMedium,
label && size === 'large' && inputStyles.labelLarge,
inputStyles[labelPosition],
state.input.className,
);
Expand All @@ -260,8 +245,6 @@ export const useCheckboxStyles_unstable = (state: CheckboxState): CheckboxState
checkboxClassNames.indicator,
indicatorStyles.base,
indicatorStyles[size],
label && labelPosition === 'before' && indicatorStyles.labelBefore,
label && labelPosition === 'after' && indicatorStyles.labelAfter,
shape === 'circular' && indicatorStyles.circular,
state.indicator.className,
);
Expand Down