Skip to content

Auto scroll to invalid elements#71

Merged
tarekio merged 5 commits intomainfrom
BYNT-1352-Autoscroll-to-invalid-field
Jun 4, 2025
Merged

Auto scroll to invalid elements#71
tarekio merged 5 commits intomainfrom
BYNT-1352-Autoscroll-to-invalid-field

Conversation

@apodacaduron
Copy link
Contributor

Jira Issue

  1. 1352

Description

On pages like Actors, Bulletins, Locations and Incidents, when adding or editing a new record, if there’s an invalid element auto scroll to the invalid element, this will make it easier for users to find the problem on the form

Checklist

  • Tests added/updated
  • Documentation updated (if needed)
  • New strings prepared for translations

API Changes (if applicable)

  • Permissions checked
  • Endpoint tests added

Additional Notes

[Any other relevant information]

@apodacaduron apodacaduron requested a review from tarekio January 20, 2025 19:54
@apodacaduron apodacaduron self-assigned this Jan 20, 2025
@tarekio tarekio requested a review from level09 January 21, 2025 20:14
Copy link
Collaborator

@level09 level09 left a comment

Choose a reason for hiding this comment

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

Perfect and works well @apodacaduron

Just very minor UX improvement: we can perhaps focus the invalid element automatically ?

pseudo code

           if (element.focus) {
            setTimeout(() => element.focus(), 300) // Wait for scroll to complete
        }
        
        

@apodacaduron
Copy link
Contributor Author

@level09 updated!

@tarekio tarekio merged commit ebcf298 into main Jun 4, 2025
7 checks passed
@tarekio tarekio deleted the BYNT-1352-Autoscroll-to-invalid-field branch June 4, 2025 19:02
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.

3 participants