-
Notifications
You must be signed in to change notification settings - Fork 51
Description
Environments
- Framework name: VanillaJS
- Moveable Component version: 0.29.2
- Testable Address
Description
In the demo I have the addGuides
button on the right hand side. Upon clicking it, it adds guides in increments of 20 to both the horizontal and vertical guides. These state of guides are found under editor.state.horizontalGuides
, editor.horizontalGuides.getGuides()
, & editor.moveableLayer.horizontalGuidelines
, along with the vertical ones in the vertical
named properties; these values are console.logged out after they are modified via addGuides
.
The singular element that is generated is snappable to the moveable guides upon clicking the button but the guides
have not been rendered. Calling forceUpdate()
on either the guides instances does not force them to render()
. But, if I interact with the guides before or after clicking the button, the new guides will render once. After that, it goes back to not rendering until I interact with it again.
Is there a way to force it to render programmatically? Or a way to a request
modifying (add,remove,move) a guide?
Edit:
It seems like retrieving the innerGuide
and calling forceUpdate()
does force the rendering. Not sure why the outer one doesn't seem to work.
2nd Edit:
In addition to calling the getInnerGuide().forceUpdate()
You'll also need to reload the guides so that you can continue adding guides via the ruler.