adopted-ember-addons / adopted-ember-addons/ember-cp-validations

Inline validations are not lazy

Đang mở
#624 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
439
Fork
172
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### Environment

- Ember Version: 3.4.8
- Ember CLI Version: 2.18.12
- Ember CP Validations Version: 4.0.0-beta.5

### Steps to Reproduce

Inline validations seem to not be lazy - the function is always executed.
Example:

```js
const Validations = buildValidations(
{
companyName: [
validator('presence', { presence: true }),
validator('length', {
min: 4,
max: 24
}),
validator('inline', {
async validate(value, options, model) {
let companyName = value.trim();
return await companyNameExists(companyName);
},
lazy: true
})
]
})
```

It always calls the last inline validator, even if the value is still empty.

Might be related to #547 ?

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.