Skip to content

bug: ion-picker cssClass not setting class to column #26653

@dkern

Description

@dkern

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x
  • Nightly

Current Behavior

The PickerColumn interface has an option cssClass: https://github.com/ionic-team/ionic-framework/blob/main/core/src/components/picker/picker-interface.ts#L40

But this class is not set onto the rendered column. In the picker class I also can't find anything related to setting the class.
https://github.com/ionic-team/ionic-framework/blob/main/core/src/components/picker/picker.tsx#L268

For the buttons (where cssClass is working correct) there is a deticated function for adding the class to the buttons.
https://github.com/ionic-team/ionic-framework/blob/main/core/src/components/picker/picker.tsx#L259

I think something like class={...getClassMap(c)} is missing there.

Expected Behavior

To render the cssClass option of PickerColumn in the column.

Steps to Reproduce

Create a simple ion-picker and add a cssClass to any column.

{
  // ...
  columns: [
    {
      name: 'custom-column',
      cssClass: 'custom-class',
      options: [
        // ...
      ],
    },
  ],
 }

Code Reproduction URL

No response

Ionic Info

Ionic:

Ionic CLI : 6.13.1 (C:\Users\daker\AppData\Roaming\npm\node_modules@ionic\cli)
Ionic Framework : @ionic/vue 6.2.4

Capacitor:

Capacitor CLI : 4.0.1
@capacitor/core : 4.1.0

Utility:

cordova-res : 0.15.4
native-run : 1.6.0

System:

NodeJS : v16.13.2 (C:\Program Files\nodejs\node.exe)
npm : 8.7.0
OS : Windows 10

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions