If a utensil has an attachment, such as a “door” that serves as an opening, and the attachment breaks off the utensil on Shabbat, it does not have the status of Mukse. Even though the attachment serves no purpose in its current state, it is nevertheless not considered Mukse because it is still viewed as part of the utensil. Since the person plans to reattach the piece, it does not lose its status as part of the utensil, and, as such, it may be moved on Shabbat. This applies even if it fell off before Shabbat. If a person notices on Shabbat that a piece of a utensil had fallen off, he may pick it up and move it somewhere for safekeeping so he can reattach it after Shabbat.
This Halacha yields ramifications for the common case of a button that falls from a garment, such as from a shirt or jacket. A loose button, of course, serves no purpose on Shabbat, and one might therefore consider it Mukse. However, since the person plans on eventually sewing the button back onto the garment, the button is still considered part of the garment, even though it is currently detached. It is therefore permissible on Shabbat to pick up a button that fell from a garment – even if it fell before Shabbat – and place it in a drawer or other safe place. This is the ruling of Hacham Ovadia Yosef, in his Halichot Olam (vol. 3, p. 207; listen to audio recording for precise citation), and Rav Shlomo Zalman Auerbach (Israel, 1910-1995), as recorded in Shemirat Shabbat Ke’hilchatah (15:68,221). Rav Yosef Shalom Elyashiv (contemporary) ruled stringently in this regard, and forbade moving a loose button on Shabbat, but as for the final Halacha, one may follow the lenient position taken by the aforementioned authorities.
Summary: If a button fell from a garment on or before Shabbat, it is not considered Mukse on Shabbat, and it thus may be moved to a safe place for storage.