Skip to content

Fix Lookup initial change detection#2092

Merged
mvorisek merged 1 commit intodevelopfrom
fix_lookup
Feb 1, 2024
Merged

Fix Lookup initial change detection#2092
mvorisek merged 1 commit intodevelopfrom
fix_lookup

Conversation

@mkrecek234
Copy link
Copy Markdown
Contributor

@mkrecek234 mkrecek234 commented Aug 16, 2023

fix #2020

@mvorisek
Copy link
Copy Markdown
Member

canLeave feature needs Behat tests

@mvorisek mvorisek marked this pull request as draft August 16, 2023 19:25
@mkrecek234
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 mvorisek removed their request for review October 20, 2023 14:11
@mvorisek
Copy link
Copy Markdown
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
Copy Markdown
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
@mvorisek mvorisek deleted the fix_lookup branch February 1, 2024 12:37
@mvorisek
Copy link
Copy Markdown
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

Development

Successfully merging this pull request may close these issues.

Lookup default value is breaking canLeave

3 participants