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 Lookup initial change detection #2092

Merged
merged 1 commit into from
Feb 1, 2024
Merged

Fix Lookup initial change detection #2092

merged 1 commit into from
Feb 1, 2024

Conversation

mkrecek234
Copy link
Contributor

@mkrecek234 mkrecek234 commented Aug 16, 2023

fix #2020

@mvorisek
Copy link
Member

canLeave feature needs Behat tests

@mvorisek mvorisek marked this pull request as draft August 16, 2023 19:25
@mkrecek234
Copy link
Contributor Author

mkrecek234 commented Aug 16, 2023

Would be nice to have behat tests for canLeave (but then for ALL form controls which is an overkill for this PR to merge) - this should not prevent merging this. If you read FUI documentation, it is clear that lookup was wrongly initialized before which is fixed now. Would be welcomed if you could contribute it if you consider it compulsory here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No change needed for another dropdown "set value" call though in

$chain->dropdown('set value', $row['value'])->dropdown('set text', $row['title']);
- here a new record in the dropdown will be added and pre-selected. This indeed needs to fire the change event in the form.

@mvorisek mvorisek changed the title Omit change event for initial setting of selected value, fixes #2020 Fix Lookup initial change detection Aug 16, 2023
@mkrecek234
Copy link
Contributor Author

@atk4/trusted-maintainers Can someone help providing the tests that @mvorisek requests for this PR to merge? This is a simple bug introduced which is fixed by the above PR. Very annoying as forms today will always prevent to be left when a lookup control is present. Thank you contributors!

@mvorisek
Copy link
Member

mvorisek commented Jan 27, 2024

The change looks correct:

docs: https://github.com/fomantic/Fomantic-UI/blob/2.9.3/src/definitions/modules/dropdown.js#L2687 (and https://fomantic-ui.com/modules/dropdown.html#behavior)

@mkrecek234 did you manage to get Behat working locally as discussed on Discord?

@mkrecek234
Copy link
Contributor Author

Unfortunately no time, @mvorisek - but can confirm that the change is 100% correct, fixing the issue correctly and according to Fomantic UI specs.

@mvorisek mvorisek marked this pull request as ready for review February 1, 2024 12:36
@mvorisek mvorisek merged commit 4a5e8f9 into develop Feb 1, 2024
45 checks passed
@mvorisek mvorisek deleted the fix_lookup branch February 1, 2024 12:37
@mvorisek
Copy link
Member

mvorisek commented Feb 1, 2024

I have merged it, it does not worsen coverage but be aware it can break anytime as no tests.

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

Successfully merging this pull request may close these issues.

Lookup default value is breaking canLeave
3 participants