Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Within a structure, tab doesn't switch to show submission error #16

Open
samnabi opened this issue Dec 14, 2016 · 4 comments
Open

Within a structure, tab doesn't switch to show submission error #16

samnabi opened this issue Dec 14, 2016 · 4 comments

Comments

@samnabi
Copy link

samnabi commented Dec 14, 2016

When a user submits a form with error, this plugin switches to the offending tab so they can see where their error is located.

Unfortunately, this behaviour doesn't happen within a structure field.

@medienbaecker
Copy link
Contributor

I added a pull request with this functionality. Could you test this @samnabi? Thanks a lot.

@samnabi
Copy link
Author

samnabi commented Jan 20, 2017

The tab now switches properly within a structure modal, but it causes a Javascript bug that freezes the browser.

A script on this page may be busy, or it may have stopped responding. You can stop the script now, open the script in the debugger, or let the script continue.

Script: http://www.shopkit.local/panel…s/js/dist/panel.min.js?v=2.4.1:4

Hard to debug the issue here, since line 4 of the minified JS file is huge.

@medienbaecker
Copy link
Contributor

I think this happens when having another plugin installed as I still can't reproduce it. Could you try disabling your installed plugins? That way I can probably debug it.

@samnabi
Copy link
Author

samnabi commented Feb 4, 2017

Looks like this error is only present on Firefox in OS X. Chrome and Safari seem to work fine.

Steps to replicate:

  1. Download Kirby Starterkit
  2. Download Tabs field at commit 8f86baa and put in in the site/fields folder
  3. Replace blog.yml blueprint with this one: blog.yml.zip
  4. Navigate to localhost/panel/pages/blog/edit
  5. Add a new structure item
  6. Leave Title blank and switch to Tab Two
  7. Put some content in the textarea and try to save the structure item
  8. The modal switches back to the first tab, highlights the required Title field, and then chokes on a JavaScript error

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants