You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it("8.3 - only scrolls once even if multiple collapsible are opened at once.",asyncfunction(){
@@ -238,6 +236,29 @@ describe("pat-collapsible", function () {
238
236
constarg_1=this.spy_scrollTo.mock.calls[0][0];
239
237
expect(arg_1.top).toBe(40);// the offset is substracted from the scroll position, so a negative offset is added to the scroll position and stops AFTER the target position.
240
238
});
239
+
240
+
it("8.6 - disables scrolling if a parent pat-collapsible has enabled it.",asyncfunction(){
Copy file name to clipboardExpand all lines: src/pat/collapsible/documentation.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -169,5 +169,5 @@ attribute. The available options are:
169
169
|`transition`|`slide`| Transition effect when opening or closing a collapsinble. Must be one of `none`, `css`, `fade`, `slide` or `slide-horizontal`. |
170
170
|`effect-duration`|`fast`| Duration of transition. This is ignored if the transition is `none` or `css`. |
171
171
|`effect-easing`|`swing`| Easing to use for the open/close animation. This must be a known jQuery easing method. jQuery includes `swing` and `linear`, but more can be included via jQuery UI. |
172
-
|`scroll-selector`|| CSS selectoror `self`. Defines which element will be scrolled into view. `self` if it is the collapsible element itself. |
172
+
|`scroll-selector`|| CSS selector, `self`or `none`. Defines which element will be scrolled into view. `self` if it is the collapsible element itself. `none` to disable scrolling if a scrolling selector is inherited from a parent pat-collapsible element.|
173
173
|`scroll-offset`||`offset` in pixels to stop scrolling before the target position defines by `scroll-selector`. Can also be a negative number. |
Copy file name to clipboardExpand all lines: src/pat/validation/documentation.md
+20-7Lines changed: 20 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,22 @@
1
1
## Description
2
2
3
-
This pattern provides a simple but powerful form validation beyond what HTML5 offers.
3
+
This pattern provides form validation based on the HTML standard and offers extended functionality like custom error messages and extra validation rules.
4
+
4
5
5
6
## Documentation
6
7
7
-
The validation pattern is triggered by a single class `pat-validation` on the form tag. The rest is handled mostly with standard HTML5 validation attributes.
8
+
The validation pattern is triggered by a single class `pat-validation` on the form tag.
9
+
The rest is handled mostly with standard HTML validation attributes.
10
+
11
+
This patterns offers:
12
+
13
+
- extra validation rules like checking for equality or checking is one date it after another.
14
+
- custom error messages.
8
15
9
-
This pattern has several advantages over standard HTML 5 form validation:
16
+
Since it is based on the HTML standard you can still use the `:valid`, `:invalid` and `:out-of-range` CSS pseudo classes.
10
17
11
-
- it supports older browsers
12
-
- it uses simple documented HTML markup to allow non-browser-specific styling of error messages
13
-
- it supports extra validation rules
18
+
You can use any HTML form validation attributes but here are some examples:
@@ -23,6 +27,10 @@ This pattern has several advantages over standard HTML 5 form validation:
23
27
| Maximum value |`type="number" max="10"`| Check if a number is less than or equal to a given value. |
24
28
| Real number |`type="number" step="any"`| Check if a number is less than or equal to a given value. |
25
29
30
+
31
+
> **_NOTE:_** The form inputs must have a `name` attribute, otherwise the validation would not happen.
32
+
33
+
26
34
### Error messages
27
35
28
36
Error messages are inserted into the DOM as `em` elements with a `message warning` class.
@@ -65,6 +73,11 @@ Error messages can also be overridden on a per-field basis, for example:
65
73
66
74
### Options reference
67
75
76
+
> **_NOTE:_** The form inputs must have a `name` attribute, otherwise the validation would not happen.
77
+
78
+
> **_NOTE:_** If you need to exclude a submit button from form validation - like a cancel button which actually submits - add the `formnovalidate` attribute to the button.
0 commit comments