Steps to reproduce:

- fresh D8
- enable fapi_example
- go to examples/fapi-example/modal-form
- enter string
- submit

Nothing happens.

Turn off JavaScript, perform the steps above, see the result. That's why the tests are passing: They don't use JavaScript.

Comments

leymannx created an issue. See original summary.

Torenware’s picture

OK, that behavior is just *wrong*. I'm not even seeing a modal form, which should "pop up" from the page.

Let me see what's up with this.

Torenware’s picture

StatusFileSize
new70.22 KB
new78.33 KB
new91.44 KB

Now I'm understanding better. Notice that there's no link to "examples/fapi-example/modal-form"; you had to navigate there yourself. There's a route for it, but you access the example via the link on the "examples/fapi-example" page. Click the "Modal Example" link and you see this:

Just the dialog

Dialog filled in

Result after dialog dismissed

So the example works; it just isn't clear that this is how you access it.

The link is magic:

<a href="/examples/fapi-example/modal-form" class="use-ajax" data-dialog-type="modal">Modal Example</a>

The Javascript recognizes the class and the data-dialog-type attribute to link it to the page at the href.

This needs to be explained. It wasn't obvious to you. It wasn't obvious to me either. I think that the target page you accessed needs to be modified to work as a demonstration to supplement that one link.

Torenware’s picture

Status: Active » Needs work
mile23’s picture

mile23’s picture

Component: Form Example » FAPI Example
mile23’s picture

Status: Needs work » Needs review
StatusFileSize
new6.48 KB

OK, so the ajax submit handler was waaaaay wrong. :-)

This patch gives us the option of showing the input form on the page, or as a dialog, with a link to the dialog if the user wants to see it.

It still suffers from the validation error seen in #2870746: Add JS functional tests for modal example, including validation phase but we'll fix that there, and add JS functional tests there too.

It's a toss-up whether this should be in the fapi example or ajax example.

  • Mile23 committed f09717a on 8.x-1.x
    Issue #2838276 by Mile23, Torenware, leymannx: Modal Form Example not...
mile23’s picture

Status: Needs review » Fixed

OK. Now we have the behavior we want, let's fix validation and add tests: [#2870746

Thanks everyone!

mile23’s picture

Component: FAPI Example » Form API Example

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.