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: set initial value using property to ensure change is fired #6606

Merged
merged 1 commit into from
Oct 6, 2023

Conversation

web-padawan
Copy link
Member

Description

Fixes #6224
Fixes #6598

This PR fixes an issue in Safari with change event not getting fired for clearing initial value set with attribute.

See #6224 (comment) for the HTML snippet that I used to reproduce and debug this issue.

Type of change

  • Bugfix

@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 6, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@vursen
Copy link
Contributor

vursen commented Oct 6, 2023

The solution looks good to me. Although, I wasn't able to reproduce the issue in my Safari (version 17.0 build 19616.1.27.211.1), which makes me think that it was a browser bug that got fixed. I've recently upgraded to Mac OS Sonoma.

@web-padawan web-padawan removed the request for review from tomivirkki October 6, 2023 11:37
@web-padawan
Copy link
Member Author

For the record, the test fails on main branch with the current WebKit Playwright build:

$ yarn test:webkit --group field-base
yarn run v1.22.19
$ web-test-runner --config web-test-runner-webkit.config.js --group field-base

packages/field-base/test/input-controller.test.js:

 ❌ input-controller > value property > should dispatch change event when clearing input
      AssertionError: expected spy to have been called exactly once, but it was called 0 times
        at r (node_modules/@esm-bundle/chai/node_modules/.pnpm/[email protected]/node_modules/chai/chai.js:9575:6)
        at node_modules/@esm-bundle/chai/node_modules/.pnpm/[email protected]/node_modules/chai/chai.js:251:8
        at node_modules/@vaadin/testing-helpers/dist/plugins/sinon-chai.js:88:25
        at e (node_modules/@esm-bundle/chai/node_modules/.pnpm/[email protected]/node_modules/chai/chai.js:7959:33)
        at packages/field-base/test/input-controller.test.js:89:24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants