Skip to content

[EuiBasicTable] mobileOptions.fullWidth does not override width property #4168

@cee-chen

Description

@cee-chen

Scenario:

const columns = [
  {
    name: 'Column',
    width: '36%',
    mobileOptions: {
      fullWidth: true,
    },
  },
  // ...
];

This outputs the following HTML:

<td class="euiTableRowCell euiTableRowCell--isMobileFullWidth" style="width: 36%;">

But unfortunately, .euiTableRowCell--isMobileFullWidth doesn't override the inline styles, so fullWidth: true is not working on mobile.

Possible solutions

  1. Add !important to .euiTableRowCell--isMobileFullWidth so that it overrides inline style widths
  2. Add the width property to mobileOptions, so users can do this instead of using fullWidth:
const columns = [
  {
    name: 'Column',
    width: '36%',
    mobileOptions: {
      width: '100%',
    },
  },
];

No strong preference/feelings here on which folks go with - whatever's either easier or feels better API-wise is fine by me!

Metadata

Metadata

Assignees

No one assigned

    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