# MobilePopupMenu SelectedRowText returns the previously selected value when popup value is blank

**URL:** <https://forum.xojo.com/t/mobilepopupmenu-selectedrowtext-returns-the-previously-selected-value-when-popup-value-is-blank/88778>\
**Category:** iOS\
**Created:** [August 20, 2026, 3:08pm UTC](https://forum.xojo.com/t/mobilepopupmenu-selectedrowtext-returns-the-previously-selected-value-when-popup-value-is-blank/88778 "2026-08-20T15:08:07Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Cox](https://forum.xojo.com/user_avatar/forum.xojo.com/david_cox/32/227_2.png) [@David\_Cox](https://forum.xojo.com/u/David_Cox)\
**Post date:** [August 20, 2026, 3:08pm UTC](https://forum.xojo.com/t/mobilepopupmenu-selectedrowtext-returns-the-previously-selected-value-when-popup-value-is-blank/88778/1 "2026-08-20T15:08:07Z")

</div>

I have a MobilePopupMenu that has a list of Countries, but the first item in the list is a blank so that no country appears as the default, but the user must select their country.

If a user selects a country (eg England) from the MobilePopupMenu then MobilePopupMenu.SelectedRowText will return the correct text (ie England).

But if a user selects a country (eg England) from the MobilePopupMenu, then selects the top Blank country value, then MobilePopupMenu.SelectedRowText will return the incorrect text (ie England) rather than the blank value that is being displayed.

Why doesn’t MobilePopupMenu.SelectedRowText return the blank value?

[https://tracker.xojo.com/xojoinc/xojo/-/work\_items/81811](https://tracker.xojo.com/xojoinc/xojo/-/work_items/81811)

---

<div class="post-metadata">

**Author:** ![Javier\_Menendez](https://forum.xojo.com/user_avatar/forum.xojo.com/javier_menendez/32/15692_2.png) [@Javier\_Menendez](https://forum.xojo.com/u/Javier_Menendez)\
**Post date:** [August 20, 2026, 4:45pm UTC](https://forum.xojo.com/t/mobilepopupmenu-selectedrowtext-returns-the-previously-selected-value-when-popup-value-is-blank/88778/2 "2026-08-20T16:45:17Z")

</div>

Hi @David_Cox

This has been fixed and will be available in the next release: [#81787 (closed)](https://tracker.xojo.com/xojoinc/xojo/-/work_items/81787)

Meanwhile, may I suggest something?

Although generally a bad idea using just an empty string as “No selection” from a UI perspective, that’s even more important under iOS. Here, when the app is running… even the “empty” options is less than noticeable for the user.

Being that said, maybe you can use this as a workaround?

Implement the SelectionChanged event handler for the PopupMenu1 instance and put the following code in the associated code editor:

```auto
if item.Text = "" then
  me.SelectedRowIndex = -1
end if

```

---

<div class="post-metadata">

**Author:** ![Javier\_Menendez](https://forum.xojo.com/user_avatar/forum.xojo.com/javier_menendez/32/15692_2.png) [@Javier\_Menendez](https://forum.xojo.com/u/Javier_Menendez)\
**Post date:** [August 20, 2026, 4:55pm UTC](https://forum.xojo.com/t/mobilepopupmenu-selectedrowtext-returns-the-previously-selected-value-when-popup-value-is-blank/88778/3 "2026-08-20T16:55:23Z")

</div>

> [@David\_Cox](#):
>
> I have a MobilePopupMenu that has a list of Countries, but the first item in the list is a blank so that no country appears as the default, but the user must select their country.

In addition, if the only purpose is that no country appears as the default, then you don’t need to do anything at all: just populate the list… and that’s all. And even if you do that using the Inspector Panel from the IDE, keeping the “Selected Row Index” to -1 is everything needed.

---

<div class="post-metadata">

**Author:** ![David\_Cox](https://forum.xojo.com/user_avatar/forum.xojo.com/david_cox/32/227_2.png) [@David\_Cox](https://forum.xojo.com/u/David_Cox)\
**Post date:** [August 20, 2026, 5:21pm UTC](https://forum.xojo.com/t/mobilepopupmenu-selectedrowtext-returns-the-previously-selected-value-when-popup-value-is-blank/88778/4 "2026-08-20T17:21:37Z")

</div>

I had tried that, but it stops the user from being able to de-select a Country back to blank after they’re chosen one.

Your workaround is best, or adding an “Unknown” option.

---

<div class="post-metadata">

**Author:** ![Javier\_Menendez](https://forum.xojo.com/user_avatar/forum.xojo.com/javier_menendez/32/15692_2.png) [@Javier\_Menendez](https://forum.xojo.com/u/Javier_Menendez)\
**Post date:** [August 20, 2026, 5:54pm UTC](https://forum.xojo.com/t/mobilepopupmenu-selectedrowtext-returns-the-previously-selected-value-when-popup-value-is-blank/88778/5 "2026-08-20T17:54:58Z")

</div>

> [@David\_Cox](#):
>
> Your workaround is best, or adding an “Unknown” option.

From a good UI perspective I’d opt for the “Uknown” version instead of an empty row 😉

---

<div class="post-metadata">

**Author:** ![Patrick\_Salo](https://forum.xojo.com/user_avatar/forum.xojo.com/patrick_salo/32/514_2.png) [@Patrick\_Salo](https://forum.xojo.com/u/Patrick_Salo)\
**Post date:** [August 20, 2026, 7:51pm UTC](https://forum.xojo.com/t/mobilepopupmenu-selectedrowtext-returns-the-previously-selected-value-when-popup-value-is-blank/88778/6 "2026-08-20T19:51:28Z")

</div>

@Javier_Menendez There’s something else to consider here as well. Often a blank or empty row is used because it makes things immediately clear how to unselect a popup menu. Visually you either have a value or don’t have a value, which makes recognition almost instantaneous, especially as folks have been trained on this model for decades now.

By using “Unknown” you introduce the scenario where the user must parse through the entire list to try and find the “not set” value. As this is fairly arbitrary, some devs might call this “Unknown”, others “None”, or maybe something else. Some popups might not even have an unset value, so the user is now on a wild goose chase, if they’re even thinking this far ahead, for some value that may or may not exist.

There’s also a semantic difference between “Unknown” and “not set.” Unknown can itself be a meaningful value, whereas a blank clearly indicates the absence of one.

So from a UX perspective, having a blank row is actually helpful and, depending upon the use case for the popup, preferred.

---

<div class="post-metadata">

**Author:** ![Javier\_Menendez](https://forum.xojo.com/user_avatar/forum.xojo.com/javier_menendez/32/15692_2.png) [@Javier\_Menendez](https://forum.xojo.com/u/Javier_Menendez)\
**Post date:** [August 20, 2026, 8:06pm UTC](https://forum.xojo.com/t/mobilepopupmenu-selectedrowtext-returns-the-previously-selected-value-when-popup-value-is-blank/88778/7 "2026-08-20T20:06:17Z")

</div>

> [@Patrick\_Salo](#):
>
> So from a UX perspective, having a blank row is actually helpful and, depending upon the use case for the popup, preferred.

Maybe, I only can tell I haven’t found any iOS app displaying blank rows yet. 🤷🏻

Anyway, it is something posible to do, so it depends on the needs of everyone 🤓

---

<div class="post-metadata">

**Author:** ![Patrick\_Salo](https://forum.xojo.com/user_avatar/forum.xojo.com/patrick_salo/32/514_2.png) [@Patrick\_Salo](https://forum.xojo.com/u/Patrick_Salo)\
**Post date:** [August 20, 2026, 9:10pm UTC](https://forum.xojo.com/t/mobilepopupmenu-selectedrowtext-returns-the-previously-selected-value-when-popup-value-is-blank/88778/8 "2026-08-20T21:10:26Z")

</div>

That’s a great call out @Javier_Menendez and I guess I was thinking too much about Desktop here where blank values are definitely a thing. So I definitely stand corrected.

Reviewing how Apple is doing this these days, it looks like they’re using the value of _None_ at the top of the list, and then adding a separator to segment this away from the values (which fixes the issue I noted of trying to find the “Not Selected” value in the list).

As this has been a topic of discussion in the forums recently, I created this ticket so that we can mirror Apple’s look and feel in Xojo iOS/iPadOS apps:

[#81816 - Add Separators to MobilePopupMenu](https://xojo.com/issue/81816)

@David_Cox Maybe you might want to thumbs up this if you’re interested in separators for mobile.

---

<div class="post-metadata">

**Author:** ![Javier\_Menendez](https://forum.xojo.com/user_avatar/forum.xojo.com/javier_menendez/32/15692_2.png) [@Javier\_Menendez](https://forum.xojo.com/u/Javier_Menendez)\
**Post date:** [August 20, 2026, 10:38pm UTC](https://forum.xojo.com/t/mobilepopupmenu-selectedrowtext-returns-the-previously-selected-value-when-popup-value-is-blank/88778/9 "2026-08-20T22:38:42Z")

</div>

There are not separators per-se, but a quite different thing:grouped menu items. That’s not, by far, the same thing.

> **[displayInline | Apple Developer Documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayinline?language=objc)**
>
> An option indicating the menu displays inline with its parent menu instead of displaying as a submenu.

---

<div class="post-metadata">

**Author:** ![Patrick\_Salo](https://forum.xojo.com/user_avatar/forum.xojo.com/patrick_salo/32/514_2.png) [@Patrick\_Salo](https://forum.xojo.com/u/Patrick_Salo)\
**Post date:** [August 20, 2026, 10:49pm UTC](https://forum.xojo.com/t/mobilepopupmenu-selectedrowtext-returns-the-previously-selected-value-when-popup-value-is-blank/88778/10 "2026-08-20T22:49:00Z")

</div>

Yes, if this is indeed backed by a UIMenu, then this will all happen as a result of the grouping of things together as children. I’ve updated the ticket but I didn’t change the title as the intention is still for there to be the ability to add a separator, even if this is just a side effect of implementing children in UIMenu (e.g. what intended result is needed separated out from the implementation details).

---

<div class="post-metadata">

**Author:** ![Javier\_Menendez](https://forum.xojo.com/user_avatar/forum.xojo.com/javier_menendez/32/15692_2.png) [@Javier\_Menendez](https://forum.xojo.com/u/Javier_Menendez)\
**Post date:** [August 20, 2026, 10:51pm UTC](https://forum.xojo.com/t/mobilepopupmenu-selectedrowtext-returns-the-previously-selected-value-when-popup-value-is-blank/88778/11 "2026-08-20T22:51:47Z")

</div>

> [@Patrick\_Salo](#):
>
> Yes, if this is indeed backed by a UIMenu, then this will all happen as a result of the grouping things together as children.

That won’t works as probably anyone would expect, because you couldn’t access _that_ particular menu item (separator), and also referring its contained childs by the regular indexing, for example.

In addition, that inlined group would add two separators: before AND after the group, and not just one separator…

---

<div class="post-metadata">

**Author:** ![Patrick\_Salo](https://forum.xojo.com/user_avatar/forum.xojo.com/patrick_salo/32/514_2.png) [@Patrick\_Salo](https://forum.xojo.com/u/Patrick_Salo)\
**Post date:** [August 20, 2026, 10:59pm UTC](https://forum.xojo.com/t/mobilepopupmenu-selectedrowtext-returns-the-previously-selected-value-when-popup-value-is-blank/88778/12 "2026-08-20T22:59:36Z")

</div>

Maybe I’m off, but I believe UIMenu will automatically render a separator between groups of children (I’m thinking about .displayInline). Yes, not being to access the separator as a menu item is actually fine and preferred. It simply needs to create a visual distinction.

I could be wrong, but I think the separator is just shown between menu elements so in the case of the iOS Calendar app screenshot from the ticket, being able to render things in this fashion, should be doable:

None  
----------  
5 minutes  
10 minutes  
30 minutes
