Skip to content

Unable to dismiss Modal windows when vistors.error object has errors in it. #5

Description

@exawatt

PROBLEM: When the modal window is initially displayed, the user is asked to select a favorite and enter a comment. If the user enters nothing in and clicks the Choose button, an error message appears, as it should. However, at this point, the user cannot dismiss the modal window by clicking the Close button or the X. The modal window stays regardless.

I think this is because of <div id="modal-form" class="modal" style="display: <%= @visitor.errors.any? ? 'block' : 'none';%>">. At this point the visitor.errors object still evaluates to true and show the div style is set to as a block instead of none.

I think that the div style should be reset to none when the user clicks the x or the close button and the visitor.errors object cleared.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions