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

[MdTable] on md-selectable="multiple", @md-selected doesn't reliably fire #1786

Closed
MystK opened this issue May 30, 2018 · 7 comments · Fixed by #1789
Closed

[MdTable] on md-selectable="multiple", @md-selected doesn't reliably fire #1786

MystK opened this issue May 30, 2018 · 7 comments · Fixed by #1789
Labels

Comments

@MystK
Copy link

MystK commented May 30, 2018

Steps to reproduce

ISSUE 1
open https://codesandbox.io/s/lrz0np1m0q in a new tab(needs to be fresh)
select 1 row
notice the selected row isn't displayed below(incorrect behavior)
unselect 1 row
select 1 row
notice the selected row is displayed below(expected behavior)

ISSUE 2
open https://codesandbox.io/s/lrz0np1m0q in a new tab
open dev tools
select 1 row
notice that there is no console log(incorrect behavior)
unselect row
notice that there is a console log(expected behavior)

Which browser?

Latest Chrome, Windows 10

@railken
Copy link

railken commented Nov 19, 2018

Hi,

i still have the problem:

https://codesandbox.io/s/o7n643p6zq

img

@aburai
Copy link

aburai commented Nov 20, 2018

this is already fixed on dev branch

i think it is this change (this.$nextTick) in MdTable.vue

      syncSelectedValue () {
        this.$nextTick().then(() => { // render the table first
          if (this.MdTable.selectingMode === 'single') {
            this.MdTable.singleSelection = this.mdSelectedValue
          } else if (this.MdTable.selectingMode === 'multiple') {
            this.MdTable.selectedItems = this.mdSelectedValue || []
          }
        })
      }

see also the change in watch

      value () {
        this.syncSelectedValue()
        this.setWidth()
      }

hope that helps

@railken
Copy link

railken commented Nov 20, 2018

As you can see here: https://codesandbox.io/s/o7n643p6zq?module=package.json, the sample code has been configured to use the dev branch.

I have also tested in a local environment (experiencing the same problem) and the package-lock.json show this:

"vue-material": {
    "version": "github:vuematerial/vue-material#383b25503e15f9d598ded3b3c0ca96b67ca856d6"
 },

@aburai
Copy link

aburai commented Nov 20, 2018

ok, i tested it with yarn dev in the table examples and it works, but in the sandbox it doesn't :(

@Samuell1
Copy link
Member

Samuell1 commented Nov 21, 2018

@railken @aburai Because dist isnt recompiled in dev branch, then using github version will use same old version.

@matt4530
Copy link

matt4530 commented Dec 17, 2018

@Samuell1 This issue seems to be duplicated a lot, but this answer (which works!) took a bit of searching to get to.

Could you build dev branch so we don't have to fork this just to build it?

@LeiwenL
Copy link

LeiwenL commented Jan 4, 2019

Hi, how about this issue ?
VueMateriel is still in active development or is being deprecated?
Thanks for your answer! 😄

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