/paper-select-related-null

Demo of ember-paper issue when passing empty relationships to paper-select components

Primary LanguageJavaScript

paper-select-related-null

This repo contains an app demonstrating an issue in Ember Paper, in which an empty Ember Data relationship is not recognized by a {{paper-select}} component as being null. In particular, this prevents required elements from actually being required, both while filling in the form and when calculating its validity.

In this example, both the author and category {{paper-select}} components include required=true:

Demonstration of issue

Author does not have an asterisk in its label, nor does it turn red and receive the notice that "This is required" when it is blurred without a selection. Most importantly, not selecting an author does not prevent the button from activating and the form being submitted.

The difference is that the author component is passed

selected=post.author

while the category component is passed

selected=(if post.category.id post.category)

which is initially null.

Prerequisites

You will need the following things properly installed on your computer.

Installation

  • git clone <repository-url> this repository
  • cd paper-select-related-null
  • npm install

Running / Development

Code Generators

Make use of the many generators for code, try ember help generate for more details

Running Tests

  • ember test
  • ember test --server

Building

  • ember build (development)
  • ember build --environment production (production)

Deploying

Specify what it takes to deploy your app.

Further Reading / Useful Links