Join the Webstudio community

Updated 4 weeks ago

how do i access active status of an element

Hey guys I have buttons that have an active and hover status. Is there a way to set one as active.
Attachments
image.png
image.png
1
A
J
J
31 comments
another example is highlighting the button in the nav when youre on that page. I know i can just add hidden dupe buttons but i was wondering if there is a better way
nav link example: There is a "current page" on the token that you can edit
Attachment
CleanShot_2024-10-31_at_15.57.572x.png
select > settings > selected
Attachment
CleanShot_2024-10-31_at_15.59.462x.png
Selected doesn't seem to exist.
It exist as aria-selected and I tried just manually creating but both don't work
What do you mean it doesn't exist, I shared a screenshot of it.
You need to select the option.
yeah i did
Attachment
image.png
if i add it myself and set as true nothing changes
Attachment
image.png
Select the token dropdown, you can use "current page". (I think this is what you're asking)
Attachment
CleanShot_2024-11-01_at_12.12.432x.png
yeah i chose the current page and set the colours
Attachment
image.png
doesnt show when im on that page.
  • cant see a selected option within the props
  • adding it myself but it doesnt work
It appears the Current Page selector only works on the published site. @Ivan Starkov Can you confirm this is a bug (as in it should work in the builder) and I'll create an issue?
im having the issue on published as well. maybe there is just something im doing wrong in teh settings
Hm okay if you send me the builder link I can take a look. Also point me to the page and instance this is on
In builder it will not work. The canvas URL is static and never changed
Can be emulated somehow cc @TrySound
But I don't think we should show it in the Builder. It's like :hover
We don't show :hover state in the builder until user select Hover state
cc @John Siciliano ^
True. At least in preview mode I think it should work
Added an issue as p2 https://github.com/webstudio-is/webstudio/issues/4359

@AdamOBryn Sounds like youre having a different issue though so feel free to share the builder link with directions where to find what you're seeing
casino explorer page on the side filter buttons
Make the link relative and it should fix it ie get rid of system.origin. No need for it plus removing it will make it work inside the builder preview mode
and by "work" I mean clicking on it and navigating to that filter. The current page status only shows on the live site but should start working once you make it relative
oh nice! and that fixes another issue with slots for me πŸ˜„
Add a reply
Sign up and join the conversation on Discord