While holding the sprint button and riding a horse, everything is as usual, until after sprinting on the horse for a few seconds and then dismounting. When you dismount, you are still sprinting, and will continue to sprint until you hold down your sprint button again and move forward. Apparently, you can even sprint backward. Again, you do not have to be holding the sprint button after dismounting to continue sprinting.
Linked issues
Comments

No, I have not.

Duplicate of MC-167454

Thank you for your report!
We're tracking this issue in MC-30403, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
-- I am a bot. This action was performed automatically! If you think it was incorrect, please notify us on Discord or Reddit
Have you set Sprint to "Toggle" or "Hold" in Accessibility settings?