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

Error when using @blur on ui-textfield #28

Closed
jfrag opened this issue Nov 10, 2020 · 6 comments
Closed

Error when using @blur on ui-textfield #28

jfrag opened this issue Nov 10, 2020 · 6 comments

Comments

@jfrag
Copy link
Contributor

jfrag commented Nov 10, 2020

<ui-textfield v-model="data.msgStr" @blur="blurField(data)" fullWidth outlined></ui-textfield>

Uncaught TypeError: Cannot read property '0' of undefined at Object.isCheckboxAtRowIndexChecked (balm-ui.js:formatted:17010) at e.handleRowCheckboxChange (balm-ui.js:formatted:16782) at HTMLTableSectionElement.handleRowCheckboxChange (balm-ui.js:formatted:16880)

Error appear only when a value is entered. If you blur without changing value no error happen

@elf-mouse
Copy link
Member

Hi @jfrag ,

I have to test your code in vue2&3, and no errors happened.

Could you give a minimal complete example to reproduce this problem! like this:

<ui-textfield
    v-model="data.msgStr"
    fullwidth
    outlined
    @blur="blurField(data)"
  ></ui-textfield>

NOTE: fullwidth prop is not fullWidth.

export default {
  data() {
    return {
      data: {
        msgStr: ''
      }
    };
  },
  mounted() {
    setTimeout(() => {
      this.data.msgStr = 'Hello';
    }, 1e3);
  },
  methods: {
    blurField({ msgStr }) {
      console.log(msgStr);
    }
  }
};

@jfrag
Copy link
Contributor Author

jfrag commented Nov 26, 2020

Hi,

My interface is a list of ui-textfield inside a ui-table

When i set the param row-checkbox to true the error disappear

<ui-table fullwidth :data="orderedLang" :thead="langHead" :tbody="langBody">
  <template #trad-val="{ data }">
    <ui-textfield v-model="data.msgStr" @blur="blurField(data)" fullwidth outlined></ui-textfield>
  </template>
</ui-table>
export default {
  data() {
    return {
      langList: {
        "a3786f3cef62ea00d7b62d774a7418be":{
          "msgId":"Language already exist",
          "msgStr":"",
          "msgStrPlurals":[],
          "flags":[],
          "translatorComments":[],
          "developerComments":[],
          "reference":["myRef"]
        },
        "2a07e356a2c9f6e1600ac7084e0df489":{
          "msgId":"Update completed",
          "msgStr":"",
          "msgStrPlurals":[],
          "flags":[],
          "translatorComments":[],
          "developerComments":[],
          "reference":["myRef2"]
        }
      },
      langHead : ['Text', 'Taduction'],
      langBody:[
        'msgId',
        {
          slot:'trad-val',
          value:'msgStr'
        }
      ]
    };
  },
  computed: {
    orderedLang() {
      return _.orderBy(this.langList, ['value']);
    }
  },
  methods: {
    blurField(field) {
      console.log(field);
    }
  }
};

The error occur when i write in the textfield and fire the blur event.

Blur error
Blur error 2

@elf-mouse
Copy link
Member

Thanks @jfrag , I will check this problem.

@elf-mouse
Copy link
Member

Hi @jfrag ,

The problem has been confirmed, it's an official MDC (@material-components) data-table component bug.

I will fix the problem in the next patch.

Thanks again :)

@jfrag
Copy link
Contributor Author

jfrag commented Nov 26, 2020

Hi @elf-mouse ,

Thank you for your fast reply !

You're doing a very good job !

@elf-mouse
Copy link
Member

This bug has been fixed now.

  • balm-ui@8.9.2 for vue2
  • balm-ui@9.2.1 for vue3

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

2 participants