Skip to content

Commit

Permalink
fix(core): Checkbox link in label is not clickable (#12636)
Browse files Browse the repository at this point in the history
* fix(core): Checkbox link in  label  is not clickable

closes [#12577](#12577)

## Description
Updated the checkbox component to ensure that links within custom labels are clickable and function as intended. This resolves the issue observed in the documentation example.

* fix(platform): table showing info bar with selected filters

closes [#11783](#11783)

- Refactored/simplified css selector for pointer event

* fix(core): do not pointer-events: auto for disabled checkboxes

* fix: e2e

---------

Co-authored-by: Mike O'Donnell <[email protected]>
Co-authored-by: deno <[email protected]>
Co-authored-by: [email protected] <[email protected]>
  • Loading branch information
4 people authored Nov 22, 2024
1 parent d615e77 commit e8b42cc
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
11 changes: 11 additions & 0 deletions libs/core/checkbox/checkbox/checkbox.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ fd-checkbox {

.fd-checkbox__label {
user-select: none;

&-container {
pointer-events: auto;
}
}

.fd-checkbox.is-disabled,
.fd-checkbox.is-readonly {
& + .fd-checkbox__label .fd-checkbox__label-container {
pointer-events: none !important;
}
}

&.fd-checkbox--standalone {
Expand Down
6 changes: 2 additions & 4 deletions libs/docs/platform/checkbox/e2e/checkbox.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ describe('Checkbox test suite', () => {
checkboxWithValue,
tristateCheckboxes,
tristateCheckboxParis,
errorCheckboxes,
presenceCheckbox,
accessibilityCheckboxes,
disabledAccessibilityCheckbox,
Expand Down Expand Up @@ -133,16 +132,15 @@ describe('Checkbox test suite', () => {

describe('Checkbox With Form and State Change on Error', () => {
it('should check error handling examples', async () => {
await scrollIntoView(errorCheckboxes, 1);
await click(errorCheckboxes, 1);
await clickNextElement(presenceCheckbox);
await waitForElDisplayed(checkboxPage.errorTooltip);
await expect((await getText(checkboxPage.errorTooltip)).trim()).toEqual(checkboxErrorTooltip);
// TODO improve hover check stability for FF
if (await browserIsFirefox()) {
console.log('skip hover check');
return;
}
}, 1);
});

it('should check error handling form submission', async () => {
await click(checkboxPage.submitBtn);
Expand Down
1 change: 0 additions & 1 deletion libs/docs/platform/checkbox/e2e/checkbox.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export class CheckboxPO extends PlatformBaseComponentPo {
checkboxWithValue = 'fdp-platform-multiselect-checkbox input';
tristateCheckboxes = 'fdp-platform-tristate-checkbox input';
tristateCheckboxParis = '.fd-checkbox__label[for=paris] span.fd-checkbox__checkmark';
errorCheckboxes = 'fdp-platform-checkbox-error-handling .fd-checkbox__label';
presenceCheckbox = 'fdp-platform-checkbox-error-handling #presence';
submitBtn = 'fdp-platform-checkbox-error-handling button';
errorTooltip = '[type="error"] span';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ <h3>Checkbox Error Handling</h3>
</fdp-form-field>
<fdp-form-field
#ffr2
id="aggrement"
id="agreement"
[validators]="validators"
[hint]="{ content: 'hint text', placement: 'left' }"
[rank]="15"
[column]="2"
[required]="true"
>
<fdp-checkbox
name="aggrement-cb"
name="agreement-cb"
title="Do you Agree with Terms and Conditions"
[formControl]="ffr2.formControl"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { CheckboxComponent, FdpFormGroupModule } from '@fundamental-ngx/platform
export class PlatformChekboxStyleComponent {
customForm = new FormGroup({
presence: new FormControl(),
aggrement: new FormControl()
agreement: new FormControl()
});
data = new SomeObject(true, true);
validators = [Validators.requiredTrue];
Expand All @@ -35,6 +35,6 @@ export class PlatformChekboxStyleComponent {
class SomeObject {
constructor(
public presence: boolean,
public aggrement: boolean
public agreement: boolean
) {}
}

0 comments on commit e8b42cc

Please sign in to comment.