Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Merge requests
!3805
Issue
#1149078
: States API doesn't work with multiple select fields
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Issue
#1149078
: States API doesn't work with multiple select fields
issue/drupal-1149078:1149078-states-api-doesnt
into
10.1.x
Overview
5
Commits
12
Pipelines
1
Changes
3
2 unresolved threads
Hide all comments
Open
Vladimir Roudakov
requested to merge
issue/drupal-1149078:1149078-states-api-doesnt
into
10.1.x
2 years ago
Overview
5
Commits
12
Pipelines
1
Changes
3
2 unresolved threads
Hide all comments
Expand
0
0
Merge request reports
Compare
10.1.x
version 11
80ed873d
1 year ago
version 10
4a587d80
1 year ago
version 9
991fe1a6
1 year ago
version 8
3ab7d47c
1 year ago
version 7
1f48b5d9
1 year ago
version 6
ecfb75f6
1 year ago
version 5
5cf9ab4c
1 year ago
version 4
2664f0d2
1 year ago
version 3
4a0bcf57
1 year ago
version 2
f32c8c2f
1 year ago
version 1
1f10d67b
2 years ago
10.1.x (HEAD)
and
latest version
latest version
4d0be715
12 commits,
1 year ago
version 11
80ed873d
12 commits,
1 year ago
version 10
4a587d80
11 commits,
1 year ago
version 9
991fe1a6
10 commits,
1 year ago
version 8
3ab7d47c
9 commits,
1 year ago
version 7
1f48b5d9
9 commits,
1 year ago
version 6
ecfb75f6
8 commits,
1 year ago
version 5
5cf9ab4c
7 commits,
1 year ago
version 4
2664f0d2
5 commits,
1 year ago
version 3
4a0bcf57
2 commits,
1 year ago
version 2
f32c8c2f
2 commits,
1 year ago
version 1
1f10d67b
1 commit,
2 years ago
3 files
+
186
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
core/misc/states.js
+
10
−
0
Options
@@ -149,6 +149,7 @@
*
* @prop {function} RegExp
* @prop {function} Function
* @prop {function} Array
* @prop {function} Number
Lee Rowlands
@larowlan
·
1 year ago
Maintainer
do we need another comment here?
Collapse replies
Tavi Toporjinschi
@vasike
·
1 year ago
@larowlan
of course ... updated
Please
register
or
sign in
to reply
Please
register
or
sign in
to reply
*/
states
.
Dependent
.
comparisons
=
{
@@ -159,6 +160,15 @@
// The "reference" variable is a comparison function.
return
reference
(
value
);
},
Array
(
reference
,
value
)
{
// Make sure value is an array.
if
(
!
Array
.
isArray
(
value
))
{
return
false
;
}
// The arrays values should match.
return
JSON
.
stringify
(
reference
.
sort
())
===
JSON
.
stringify
(
value
.
sort
());
},
Number
(
reference
,
value
)
{
// If "reference" is a number and "value" is a string, then cast
// reference as a string before applying the strict comparison in
Loading
do we need another comment here?
@larowlan of course ... updated