stuyspec / cms

New CMS using React + Typescript.
MIT License
5 stars 10 forks source link

When trying to open the multiple photos menu on articles with multiple photos, the article form closes #57

Open AndySok opened 3 years ago

AndySok commented 3 years ago

See the title. If you try clicking on "show all photos" button, it should bring up the photos menu. Instead, the form treats the click as if the user edited the article, and closes the form instead.

image

How to reproduce:

  1. Go on any draft or article that has multiple photos
  2. Try opening the multiple photos menu
  3. The problem will occur at this step
DJankauskas commented 3 years ago

Person who originally wrote the CMS here: this is a decently simple fix! The button is within a form tag, so clicking on it submits the form by default. The solution is to add type="button" to the button element to suppress that default. The relevant code is in this repo here, which is published as an npm package. The picture and chart components are shared across the CMS and stuyspec.com with that package. In order to make the change, one needs to first fix the package, publish a new version to npm, and then update the dependency in CMS and stuyspec.com. You might need the credentials for the account; feel free to email me if you do.

Once fixing it, you'll expose another bug: the styling of the fullscreen popup is horribly broken within the CMS. No idea why that's the case, but that's another issue for another time haha.

AndySok commented 3 years ago

For devs: see Darius' response to the issue