Skip to content

Table unusable on mobile #138

@Nemi5150

Description

@Nemi5150

Is your feature request related to a problem? Please describe.
When viewing the plugin page on mobile the table shows only with the status icon as shown below:

image

Describe the solution you'd like
If you set a default column it will show like below:

image

Additional context
To make this happen you have to override the get_primary_column_name function in MailAdminTable and return the column name you want to set as primary. example below:

    function get_primary_column_name() {
        return 'email_to';
    }

In this case it will show correctly but when the row is expanded it will display incorrectly since the primary column is no longer the first column (example below):
image

To fix this problem you need to move the status column so that email_to is the first column after cb, like shown below

   function get_columns()
    {
        $columns = [
            'cb' => '<input type="checkbox" />',
            'email_to' => __('To', 'WpMailCatcher'),
            'subject' => __('Subject', 'WpMailCatcher'),
            'email_from' => __('From', 'WpMailCatcher'),
            'status' => '',
            'time' => __('Sent', 'WpMailCatcher'),
            'more_info' => ''
        ];

        return $columns;
    }

After doing this, the mobile view will look like this:
image

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions