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

FIO-6578: Fixes an issue with losing focus on Year field when Day component has advanced logic #5301

Merged
merged 2 commits into from
Aug 10, 2023

Conversation

alexandraRamanenka
Copy link
Contributor

@alexandraRamanenka alexandraRamanenka commented Aug 7, 2023

Link to Jira Ticket

https://formio.atlassian.net/browse/FIO-6578

Description

Because Day component has three inputs (Day, month and year), formiojs was not able to properly restore focus on it after redrawing, so I adjusted saveCaretPosition function and focus funtion, now it saves field name (day, month or year) instead of input index for Day component and Day component accepts it as an argument to focus a specific field instead of the first one.

This fix is for restoring focus properly on the Day component after redraw, but this issue also was happenning because unneccessary redraws were happenning (Even when nothing has changed after logic ccheck). That was caused by assigning min and maxDate properties to this.component inside get validationValue(). Since it was assigned to the component's schema after constructor has been called, the originalComponent property did not have those properties leading to redrawing component on each logic check. This issue is already fixed on the master branch as part of the other fix. #5024

Dependencies

#5024

How has this PR been tested?

Functionality was tested manually and covered with automated tests as well

Checklist:

  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • My changes include tests that prove my fix is effective (or that my feature works as intended)
  • New and existing unit/integration tests pass locally with my changes
  • Any dependent changes have corresponding PRs that are listed above

@travist travist merged commit feef3bd into master Aug 10, 2023
lane-formio pushed a commit that referenced this pull request Sep 26, 2023
…ponent has advanced logic (#5301)

* FIO-6578: Fixes an issue with losing focus on Year field when Day component has advanced logic

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

Successfully merging this pull request may close these issues.

2 participants