Since upgrading from v2.0.0-rc.28 to v2.1.0 I've been noticing the following error appearing in the browser console from time to time:
[Vue warn]: Error in v-on handler: "TypeError: this.$refs.tbody is undefined"
found in
---> <BTr>
<BTbody>
<BTable>
// ...
<Root> vue.runtime.esm.js:619
TypeError: "this.$refs.tbody is undefined"
getTbodyTrs mixin-tbody.js:32
getTbodyTrIndex mixin-tbody.js:54
emitTbodyRowEvent mixin-tbody.js:59
rowHovered mixin-tbody-row.js:90
VueJS 3
vue.runtime.esm.js:1888
This appears to be the offending line: https://github.com/bootstrap-vue/bootstrap-vue/blob/v2.1.0/src/components/table/helpers/mixin-tbody.js#L27
Steps to reproduce the bugWhat I believe is happening is that a row-hovered (or row-unhovered) event is triggered as a user passes his cursor over a <b-table>
component. Then, before the event has been fully handled, the user triggers another action that removes the tbody from the DOM (in our case we noticed the problem when moving the cursor up over a table to click a navigation button that triggers routing).
I've been able to - somewhat - consistently reproduce this bug by performing the actions described above (the hover and then route must be done in quick succession obviously).
Expected behaviorI don't expect to be seeing console errors or warnings in this case. I just expect the handler to stop gracefully. I'm not sure what the best solution is for this one. Maybe check for the existence of tbody and just bail out if it is undefined?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4