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

Checkbox rendering depends on attribute order #140

Open
jrauh01 opened this issue Dec 18, 2024 · 0 comments
Open

Checkbox rendering depends on attribute order #140

jrauh01 opened this issue Dec 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jrauh01
Copy link

jrauh01 commented Dec 18, 2024

I have identified an issue where the order of attributes in the configuration array for a checkbox element affects whether it is rendered as checked or unchecked. This behavior is unexpected because the order of attributes in the array should not matter.

The following code works as expected, rendering the checkbox as checked:

$checkbox = $this->createElement(
    'checkbox',
    'checkbox-xy',
    [
        'class'          => 'autosubmit',
        'checkedValue'   => 'a',
        'uncheckedValue' => 'b',
        'value'          => 'a',
    ]
);

However, the following code renders the checkbox as unchecked, even though it should be checked:

$checkbox = $this->createElement(
    'checkbox',
    'checkbox-xy',
    [
        'class'          => 'autosubmit',
        'value'          => 'a',
        'checkedValue'   => 'a',
        'uncheckedValue' => 'b',
    ]
);
@nilmerg nilmerg added the bug Something isn't working label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants