Skip to content

Commit 4321c1e

Browse files
committed
more generic
1 parent 8c33015 commit 4321c1e

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed

documentation/docs/98-reference/.generated/client-warnings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ To resolve this, ensure you're comparing values where both values were created w
226226
### transition_slide_display
227227
228228
```
229-
The `slide` transition does not work correctly with elements with `display: %value%`
229+
The `slide` transition does not work correctly for elements with `display: %value%`
230230
```
231231
232232
The [slide](/docs/svelte/svelte-transition#slide) transition works by animating the `height` of the element, which requires a `display` style like `block`, `flex` or `grid`. It does not work for:

packages/svelte/messages/client-warnings/warnings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ To resolve this, ensure you're comparing values where both values were created w
189189
190190
## transition_slide_display
191191
192-
> The `slide` transition does not work correctly with elements with `display: %value%`
192+
> The `slide` transition does not work correctly for elements with `display: %value%`
193193
194194
The [slide](/docs/svelte/svelte-transition#slide) transition works by animating the `height` of the element, which requires a `display` style like `block`, `flex` or `grid`. It does not work for:
195195

packages/svelte/src/internal/client/warnings.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,12 @@ export function state_proxy_equality_mismatch(operator) {
168168
}
169169

170170
/**
171-
* The `slide` transition does not work correctly with elements with `display: %value%`
171+
* The `slide` transition does not work correctly for elements with `display: %value%`
172172
* @param {string} value
173173
*/
174174
export function transition_slide_display(value) {
175175
if (DEV) {
176-
console.warn(`%c[svelte] transition_slide_display\n%cThe \`slide\` transition does not work correctly with elements with \`display: ${value}\`\nhttps://svelte.dev/e/transition_slide_display`, bold, normal);
176+
console.warn(`%c[svelte] transition_slide_display\n%cThe \`slide\` transition does not work correctly for elements with \`display: ${value}\`\nhttps://svelte.dev/e/transition_slide_display`, bold, normal);
177177
} else {
178178
console.warn(`https://svelte.dev/e/transition_slide_display`);
179179
}

packages/svelte/src/transition/index.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,7 @@ var slide_warning = false;
108108
export function slide(node, { delay = 0, duration = 400, easing = cubic_out, axis = 'y' } = {}) {
109109
const style = getComputedStyle(node);
110110

111-
if (
112-
DEV &&
113-
!slide_warning &&
114-
(style.display.includes('table') ||
115-
style.display.includes('inline') ||
116-
style.display === 'contents')
117-
) {
111+
if (DEV && !slide_warning && /(contents|inline|table)/.test(style.display)) {
118112
slide_warning = true;
119113
Promise.resolve().then(() => (slide_warning = false));
120114
w.transition_slide_display(style.display);

0 commit comments

Comments
 (0)