Polaris-react: ActionList item's onAction submits ancestor form

Created on 2 Aug 2018  路  3Comments  路  Source: Shopify/polaris-react

Issue summary

If an ActionList component is used inside a form element, selecting any action from the list triggers the form's onSubmit handler:

action-list-bug

Source for the above GIF is here.

Expected behavior

Clicking an item should not trigger an ancestor form's onSubmit handler.

Actual behavior

Clicking an item triggers an ancestor form's onSubmit handler.

Steps to reproduce the problem

Demo code here.

Problem outline:

  1. Wrap an ActionList in a form element with an onSubmit handler.
  2. Click an item on the ActionList.

Specifications

  • Are you using the React components? (Y/N): Y
  • Polaris version number: 2.5.0
  • Browser: Chrome Version 67.0.3396.99 (Official Build) (64-bit)
  • Device: MacBook Pro
  • Operating System: macOS Sierra Version 10.12.6 (16G29)

Most helpful comment

We鈥檝e fixed this internally and it will be available in the next release

All 3 comments

Thanks for the issue @andrewpye. I鈥檒l open an internal issue for this.

We鈥檝e fixed this internally and it will be available in the next release

This is fixed in 2.6.0 馃憤

Was this page helpful?
0 / 5 - 0 ratings