Skip to content

Conversation

esmiralha
Copy link

fixed a typo in a code example for the toggle command

@zyriab
Copy link
Contributor

zyriab commented Jul 31, 2025

This is not a typo, see this test.
You toggle X on Y. *display is not owned by the next <div/>, it's a class that you toggle (add/remove) on it.

Hope that made sense 😄

@esmiralha
Copy link
Author

This is not a typo, see this test.
You toggle X on Y. *display is not owned by the next <div/>, it's a class that you toggle (add/remove) on it.

Hope that made sense 😄

I might be at fault here, but I couldn't make the example work as it is in the docs. I had to change "on" to "of" to make it work for *display.

@esmiralha
Copy link
Author

If you look at line 161 of the test it uses "of" instead of "on".

@zyriab
Copy link
Contributor

zyriab commented Aug 3, 2025

Oh interesting!

@geoffrey-eisenbarth
Copy link
Contributor

geoffrey-eisenbarth commented Aug 3, 2025

@zyriab The docs specifically mention using of for toggling *opacity

toggle [the | my] ('*opacity' | '*visibility' | '*display')
 [of <expression>]
  [(for <time expression>) |
   (until <event name> [from <expression>]]`

@esmiralha
Copy link
Author

yup but the code example at the bottom of the page uses on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants