* fix(combobox): don't use setAttribute for disabled/enabled attributes
How to reproduce this bug:
1. Go to https://lion.js.org/components/combobox/overview/ or just use the combobox in your application.
2. Inspect the combobox in the browser. Click on the `<lion-combobox>` element at the DOM inspector.
3. At the JavaScript console, print `$0.disabled`. Observe it is currently `false`, and the user can interact with it normally.
4. (optional) Run `$0.disabled =true`. Observe the user cannot interact with it anymore. That's expected.
5. Run `$0.disabled = false`.
BUG: The user cannot interact with the combobox anymore, despite `disabled` being false.
Root cause: If you inspect the `<input>` element, you can see it has `disabled="false"`.
The [specs](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#enabling-and-disabling-form-controls:-the-disabled-attribute) say:
> The `disabled` content attribute is a [boolean attribute](https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attribute).
>
> A form control is **disabled** if any of the following are true:
> * the element is a `button`, `input`, `select`, `textarea`, or form-associated custom element, and the `disabled` attribute is specified on this element (regardless of its value);
And [also](https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attribute):
> A number of attributes are **boolean attributes**. The presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value.
Thanks to @thematho for finding the root cause.
* fix(combobox): add support for disabled and readonly states with corresponding tests
* Update packages/ui/components/combobox/src/LionCombobox.js
Co-authored-by: Thijs Louisse <t_louisse@hotmail.com>
* Update packages/ui/components/combobox/src/LionCombobox.js
Co-authored-by: Thijs Louisse <t_louisse@hotmail.com>
* Update packages/ui/components/combobox/src/LionCombobox.js
Co-authored-by: Thijs Louisse <t_louisse@hotmail.com>
* fix(combobox): added accessibility tests
---------
Co-authored-by: Denilson Sá Maia <denilsonsa@gmail.com>
Co-authored-by: Thijs Louisse <t_louisse@hotmail.com>
This fix is similar to the previous commit.
Under very specific circumstances on a very complicated application logic, a file input field (that
extends from FocusMixin) gets created and immediately destroyed. This unfortunately causes an
error, because the `disconnectedCallback()` gets called to remove the event listeners for a
component that hasn't been fully set up.
> Uncaught TypeError: this._focusableNode is null
In our application, there is a very complicated logic that creates a bunch of form fields based on some data. It's very complicated, we hate that logic; but it exists, it works, and it is being used in production.
Somewhere in that logic, under a very specific case, a datepicker form field is created, connected, and then immediately disconnected. Don't ask me why, I said it is complicated.
This commit fixes a bug in OverlayMixin. The `connectedCallback` calls `_setupOverlayCtrl()` asynchronously, after a `Promise.then()`. Thus, by the time this setup function is called, the component has already been disconnected (and `disconnectedCallback()` has already been called).
The fix is simple: don't try to setup the overlay if the component is no longer connected.
* feat(input-tel): use first preferred region to set a default region
Takes priority over locale, but comes after user input
* chore(input-tel): add changeset
* fix(input-tel): use full locale to translate country names in dropdown
* test(input-tel): add test for nameForLocale in input tel dropdown
* test(input-tel): update name for locale test suite to fr-BE locale
* feat(input-stepper): add alignToStep property to align value with step size
* Create silver-eyes-count.md
* refactor: make alignTosTep property behavior as default behavior and remove property attribute
* test(input-stepper): handle min value as Infinity and update tests for decrement/increment behavior
---------
Co-authored-by: Manuel Servais <manuel.servais@ing.com>
* fix(validate-mixin): determine if a required validator or result validator has been registered based on characteristics
* chore(validate-mixin): create changeset
* Add failing tests
* Fix the issues with indeterminate checkbox
* Update the fix
* Clean up the code
* Add changeset
* Fix a type issue
* Refactor the code
* Fix a bug regarding disabled checked sub checkbox
* Add test case where subCheckboxes are added and removed dynamically
* Make a few node reference optional as it spits undefined error when the element is removed
* Update polish translations for MinNumber and MaxNumber
Polish translations of the MinNumber and MaxNumber validation error messages indicate that min, max is an open interval.
* add changeset
* fix(input-amount): parse amount always on locale once the amount is formatted
* chore: add unit test
* chore: add some description
* chore: update playwright script to install dependencies
* Update .github/workflows/verify-pr.yml
* chore: set formatOptions temp and cleanup for programmatic api
* feat(form-core): add "user-edit" mode to formatOptions while editing existing value of a form control
* chore: enhance code readability and robustness
---------
Co-authored-by: Thijs Louisse <thijs.louisse@ing.com>