Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 fix(bal-input): Duplicate id's and unable to set own id's #1569

Merged
merged 9 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions .changeset/short-seals-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@baloise/ds-core': patch
---

**field**: fix id generation to prevent duplicate ids in a form
5 changes: 5 additions & 0 deletions .changeset/thick-lies-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@baloise/ds-core': patch
---

**core**: Fix id assignment of bal-field children
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/core/src/components/bal-field/bal-field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export class Field implements ComponentInterface, BalMutationObserver {
'bal-field-control bal-file-upload',
])

const ariaForm = defaultBalAriaForm
const ariaForm = { ...defaultBalAriaForm }

if (label) {
ariaForm.labelId = `${this.fieldId}-lbl`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,45 @@
<bal-doc-app>
<main class="container py-medium">
<section data-testid="basic">
<bal-select multiple data-testid="basic-input" placeholder="Placeholder">
<bal-select-option label="Option 1" value="opt-1">Option 1</bal-select-option>
<bal-select-option label="Option 2" value="opt-2">Option 2</bal-select-option>
<bal-select-option label="Option 3" value="opt-3">Option 3</bal-select-option>
<bal-select-option label="Option 4" value="opt-4">Option 4</bal-select-option>
<bal-select-option label="Option 5" value="opt-5">Option 5</bal-select-option>
<bal-select-option label="Option 6" value="opt-6">Option 6</bal-select-option>
<bal-select-option label="Option 7" value="opt-7">Option 7</bal-select-option>
</bal-select>
<bal-field>
<bal-field-label>Label</bal-field-label>
<bal-field-control>
<bal-select multiple data-testid="basic-input" placeholder="Placeholder">
<bal-select-option label="Option 1" value="opt-1">Option 1</bal-select-option>
<bal-select-option label="Option 2" value="opt-2">Option 2</bal-select-option>
<bal-select-option label="Option 3" value="opt-3">Option 3</bal-select-option>
<bal-select-option label="Option 4" value="opt-4">Option 4</bal-select-option>
<bal-select-option label="Option 5" value="opt-5">Option 5</bal-select-option>
<bal-select-option label="Option 6" value="opt-6">Option 6</bal-select-option>
<bal-select-option label="Option 7" value="opt-7">Option 7</bal-select-option>
</bal-select>
</bal-field-control>
<bal-field-message>Message</bal-field-message>
</bal-field>
</section>
<section data-testid="disabled">
<bal-select multiple disabled value="opt-1,opt-2">
<bal-select-option label="Option 1" value="opt-1">Option 1</bal-select-option>
<bal-select-option label="Option 2" value="opt-2">Option 2</bal-select-option>
</bal-select>
<bal-field>
<bal-field-label>Label</bal-field-label>
<bal-field-control>
<bal-select multiple disabled value="opt-1,opt-2">
<bal-select-option label="Option 1" value="opt-1">Option 1</bal-select-option>
<bal-select-option label="Option 2" value="opt-2">Option 2</bal-select-option>
</bal-select>
</bal-field-control>
<bal-field-message>Message</bal-field-message>
</bal-field>
</section>
<section data-testid="invalid">
<bal-select multiple invalid value="opt-1,opt-2">
<bal-select-option label="Option 1" value="opt-1">Option 1</bal-select-option>
<bal-select-option label="Option 2" value="opt-2">Option 2</bal-select-option>
</bal-select>
<bal-field>
<bal-field-label>Label</bal-field-label>
<bal-field-control>
<bal-select multiple invalid value="opt-1,opt-2">
<bal-select-option label="Option 1" value="opt-1">Option 1</bal-select-option>
<bal-select-option label="Option 2" value="opt-2">Option 2</bal-select-option>
</bal-select>
</bal-field-control>
<bal-field-message>Message</bal-field-message>
</bal-field>
</section>
<section data-testid="field">
<bal-field>
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/utils/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export interface BalAriaFormLinking {
setAriaForm(ariaForm: BalAriaForm): Promise<void>
}

export const defaultBalAriaForm: BalAriaForm = {
export const defaultBalAriaForm: BalAriaForm = Object.freeze({
controlId: undefined,
labelId: undefined,
messageId: undefined,
}
})