The Messenger of Allah ﷺ ruled that the right of pre-emption applies to every joint property that has not yet been divided, whether a dwelling or a walled garden. It is not lawful for a partner to sell his share until he notifies his co-partner. The partner may then take it if he wishes or leave it if he wishes. If the seller sells without notifying him, the partner has the greater right to it.
أخبرنا محمد بن العلاء قال أنبأنا ابن إدريس عن ابن جريج عن أبي الزبير
قضى رسول الله ﷺ بالشفعة في كل شركة لم تقسم ربعة وحائط لا يحل له أن يبيعه حتى يؤذن شريكه فإن شاء أخذ وإن شاء ترك وإن باع ولم يؤذنه فهو أحق به