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

originalIndex different on mobile (tested in Safari on iOS) #944

Open
1 task done
titusdecali opened this issue Sep 3, 2022 · 1 comment
Open
1 task done

originalIndex different on mobile (tested in Safari on iOS) #944

titusdecali opened this issue Sep 3, 2022 · 1 comment

Comments

@titusdecali
Copy link

titusdecali commented Sep 3, 2022

Issue Type (delete the irrelevant ones)

  • Bug

Specs

"vue-good-table-next": "^0.2.1",

What browser?
iOS Safari

Expected Behavior

originalIndex is ordered as expected in desktop (even when resizing to responsive mode)

Actual Behavior

in iOS Safari, the order is different and does not match data sorting.

Steps to Reproduce the Problem

Please detail your steps here

  1. Use originalIndex to set a column (rank).
  2. Sort the table by Sent and see that the rank column uses different index on desktop vs mobile (safari iOS)

I am using initialSortBy: { field: 'sent', type: 'desc' }, so the crown and order should rank the same as the the Sent values, but on mobile they follow a different index. Please note the highlighted Sent column sorting is the same on both devices, but the crown does not follow the top Sent value on mobile.

DESKTOP (Chrome)

SHOT 23 22 07@2x

iOS Safari (landscape mode, but

Mobile
it is affected in any orientation)

// TEMPLATE

      <vue-good-table
        :columns="columns"
        :rows="leaderboard"
        compact-mode
        :sort-options="{
          enabled: true,
          initialSortBy: { field: 'sent', type: 'desc' }
        }"
      >

// custom template
      <template slot="table-row" scope="props">
          <span v-if="props.column.field === `rank`">
          <img v-if="props.row.originalIndex === 0" src="[CROWNIMAGE](https://cdn.imgbin.com/24/5/14/imgbin-crown-golden-crown-gold-crown-KAv25kNQqNfUJwnSn2U1TxhLe.jpg)" alt="#1" />
            <div v-else class="text-center">
              {{ props.row.originalIndex + 1 }}
            </div>
        </span>
     </template>
</vue-good-table>

// DATA

 columns: [
    {
       label: '#',
       field: 'rank',
    },
    {
       label: 'Amount Sent',
       field: 'sent',
       type: 'number' 
    },
        ...

jsfiddle

Mobile only issue and is hard to see when using jsfiddle or codesandbox due to their bad mobile formatting.

@titusdecali
Copy link
Author

PS: As this is the -next version, I'm not sure where else to post besides the original vue-good-table issues as there is no issues tracker for Boris' -next repo

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

No branches or pull requests

1 participant