Skip to content

Commit 4e7a48b

Browse files
authored
feat: add ModalityMode enum (#22295)
Introduce ModalityMode with three modes: STRICT, VISUAL and MODELESS. Part of: #22279
1 parent 12e49c4 commit 4e7a48b

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright 2000-2025 Vaadin Ltd.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
16+
17+
package com.vaadin.flow.component;
18+
19+
import com.vaadin.flow.dom.DomListenerRegistration;
20+
21+
/**
22+
* Dialog modality mode.
23+
*/
24+
public enum ModalityMode {
25+
26+
/**
27+
* Doesn’t use modality at all. No modality curtain, focus trap, pointer
28+
* event blocking, and request blocking.
29+
*/
30+
MODELESS,
31+
/**
32+
* A visual curtain dims the background behind the dialog, trapping focus
33+
* and blocking pointer events. Background components can't receive requests
34+
* unless explicitly enabled via low-level APIs like
35+
* {@link DomListenerRegistration#allowInert()}.
36+
*/
37+
STRICT,
38+
/**
39+
* Behaves like {@link #STRICT} except that request are not blocked.
40+
*/
41+
VISUAL
42+
}

0 commit comments

Comments
 (0)