Skip to content

feat(many): add labelPlacement prop, justify prop, and rich content styles for select options#31138

Open
thetaPC wants to merge 55 commits into
nextfrom
FW-7290
Open

feat(many): add labelPlacement prop, justify prop, and rich content styles for select options#31138
thetaPC wants to merge 55 commits into
nextfrom
FW-7290

Conversation

@thetaPC
Copy link
Copy Markdown
Contributor

@thetaPC thetaPC commented May 12, 2026

Issue number: resolves internal


What is the current behavior?

  • ion-select-option doesn't expose labelPlacement or justify props
  • The ionic theme's overlay rendering doesn't match the latest design
  • <ion-icon> placed inside an ion-select-option renders empty in Vue/React (and other frameworks that bind custom-element props as DOM properties)
  • Slotted children in select-option-start / select-option-end aren't size-capped consistently: oversized content
  • Several theme style files (alert.{ios,md,ionic}.scss, action-sheet.ionic.scss, select-{modal,popover}.{ios,md,ionic}.scss) import the wrong shared partials

What is the new behavior?

  • Add labelPlacement and justify props to ion-select-option and pass them through to alert, popover, and modal overlay paths
  • Update the ionic theme's alert, popover, and modal overlay styles to match the current design
  • Add per-theme slot-size limitations so oversized slotted content is capped to keep option rows visually uniform within an overlay
  • Audit and correct the @use / @import chains in the affected theme stylesheets so each theme file pulls in the right shared partials (mixins, theme globals, common base) and no longer relies on transitive imports that weren't guaranteed
  • Add reflectPropertiesToAttributes to core/src/utils/sanitization/ and call it from getOptionContent immediately before cloneNode. The helper mirrors a registered set of custom-element DOM properties (icon, name, src, ios, md on ion-icon) onto attributes so the cloned overlay copy renders correctly regardless of how the framework bound the prop.
  • Add test pages and Playwright snapshots for the overlays

Does this introduce a breaking change?

  • Yes
  • No

Other information

Dev build: 8.8.9-dev.11779411201.1a483e09

Preview:

@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ionic-framework Ready Ready Preview, Comment Jun 2, 2026 8:16pm

Request Review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created the select option style to make sure all interfaces are being targeted from one source of truth. By doing this, we reduce the chances of things getting lost with copy and paste.

* regardless of the content.
*/

// Avatar / Image / SVG / Thumbnail / Icon
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to only update the size for these components based on the Figma design appearing to only support images and icons. This would also follow how MD behaves.

// --------------------------------------------------

/**
* Cap slotted children so they can't stretch the option
Copy link
Copy Markdown
Contributor Author

@thetaPC thetaPC Jun 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sizes for the slotted children within this file were based off the official Sketch designs for iOS 18 for components that are supported for start and end slots. Since iOS does not have an official select option, I determined the values based on the list component it has.

* regardless of the content.
*/

// Avatar / Image / SVG / Thumbnail
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since iOS does not have an official select option, I determined the values based on the list component it has.

Images are considered to be a supported component as shown in the Sketch design. The same value can be seen being used in the Menu list for images.

height: 44px;
}

// Icon
Copy link
Copy Markdown
Contributor Author

@thetaPC thetaPC Jun 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since iOS does not have an official select option, I determined the values based on the list component it has.

Icons are considered to be a supported component as shown in the Sketch design for the Menu list.

// --------------------------------------------------

/**
* Cap slotted children so they can't stretch the option
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sizes for the slotted children within this file were based off the official specs for MD3 for components that are supported for start and end slots. Since MD does not have an official select option, I determined the values based on the list component it has.

* regardless of the content.
*/

// Avatar
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since MD does not have an official select option, I determined the values based on the list component it has.

Avatars are considered to be a supported, the size can be found under "Tokens & specs > Token > Size and typography".

height: 40px;
}

// Icon
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since MD does not have an official select option, I determined the values based on the list component it has.

Icons are considered to be a supported, the size can be found under "Tokens & specs > Token > Size and typography".

height: 24px;
}

// Image / SVG / Thumbnail
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since MD does not have an official select option, I determined the values based on the list component it has.

Images are considered to be a supported, the size can be found under "Tokens & specs > Token > Size and typography".

height: 56px;
}

// Video
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since MD does not have an official select option, I determined the values based on the list component it has.

Videos are considered to be a supported, the size can be found under "Tokens & specs > Token > Size and typography".

@thetaPC thetaPC requested a review from brandyscarney June 2, 2026 21:22
@thetaPC thetaPC changed the title feat(many): add rich content styles for select options feat(many): add labelPlacement prop, justify prop, and rich content styles for select options Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: angular @ionic/angular package package: core @ionic/core package package: vue @ionic/vue package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants