The latest Dragonflight Alpha Build 45232 introduces a new option called “press and hold casting”. If enabled, it allows you to press and hold a keyboard hotkey to continually cast a spell on the Action Bar without repeatedly having to press the button.¬†

You can enable the function under Options > Gameplay > Interface > Combat.