Look some stuff up on the wiki sight.
According to it,
"All the master must do is test the strength of the one they have chosen by allowing him or her to hold their Keyblade. If the Keyblade also approves of the heir, it will stay in the heir's hand and not automatically return to the master."
When sora handed the keyblade to jack, it didn't go back right away until he summoned it back.