-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Experimental support for CSS Drag detection #1750
Conversation
Hey! Sorry to get back to you so late. That does seem to work |
Thanks for testing @brys0 ! I've added a small update that will enable this feature via an experimental option: // Create application with options
err := wails.Run(&options.App{
Title: "reactsprojec",
Width: 1024,
Height: 768,
Assets: assets,
BackgroundColour: &options.RGBA{R: 27, G: 38, B: 54, A: 1},
OnStartup: app.startup,
Bind: []interface{}{
app,
},
Experimental: &options.Experimental{
UseCSSDrag: true,
},
}) For now it still outputs a message to the console indicating which drag method it's using. If this works, I'll update docs and merge 👍 |
Merging this experimental flag as a means for people to test css drag before deprecating the current way |
Hey! So, there's an actually with the current CSS draggable implementation. In vue if you try to make the style dynamic i.e :style=" |
I suspect this is also an issue on other dynamically generated template. Like Svelte, or React as well. |
I think that's fine. The requirement is to have that style there in whatever way you want. If it isn't there, the CSS selector won't work. |
So, it's the intended effect not to work with dynamic styling? |
That's not the intent but it is a side effect. Applying it directly works though. We could change it to a CSS property but there isn't a standard one and in my testing, the ones commonly used weren't always picked up by the CSS selector. Happy to also add a CSS property as a trigger if you can find one that works cross platform and doesn't override any intended behaviour of the attribute. Could also make it user configurable 🤔 that sounds awesome 😃 |
This PR adds experimental support for CSS defined drag regions using the
--wails-drag
CSS variable. To test:wails.useCSSDrag()
Drag type can be toggled so you can test both original and new drag testers:
To specify a non-draggable region within a draggable region, use any value other than
drag
for the css variable.