Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table unusable on mobile #138

Open
Nemi5150 opened this issue Apr 20, 2022 · 0 comments
Open

Table unusable on mobile #138

Nemi5150 opened this issue Apr 20, 2022 · 0 comments
Assignees

Comments

@Nemi5150
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants