praella-agency / polaris-vue

Polaris Vue by HulkApps is a component library for Vue.js based on Shopify Polaris style guide.
https://polaris-vue.hulkapps.com
MIT License
37 stars 10 forks source link

Fix props & events not falling through to input #104

Open Gui-JVale opened 2 years ago

Gui-JVale commented 2 years ago

I was about to create a new issue but figured I'd just make a PR instead. Here was the description I was about to leave:

Describe the bug

On the PTextField input component the props, attributes, and event listeners are getting added to the root level element as opposed to the input itself.

Event though those are correctly bound to the input using v-bind and v-on, on the options api the attribute inheritAttrs isn't specified as false, and so it ends up in the root element anyways.

To Reproduce Steps to reproduce the behavior:

  1. Render a PTextField component and try any events other then @input, like @blur/@focus out or a [data-attr]
  2. Inspect the DOM and observe that data attributes don't end up in the input
  3. Observe that events other then @input don't get fired

Expected behavior Props, attrs and listeners should get bound to the input element.