Skip to content
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

[WASM] Implement Cursors API #7295

Merged
merged 3 commits into from
Jan 1, 2022
Merged

Conversation

Mikolaytis
Copy link
Contributor

Even custom cursors are working.

@@ -254,9 +255,11 @@ protected override void OnAfterRender(bool firstRender)
Threading.Dispatcher.UIThread.Post(async () =>
{
_inputHelper = await InputHelperInterop.ImportAsync(Js, _inputElement);
_canvasHelper = await InputHelperInterop.ImportAsync(Js, _htmlCanvas);
Copy link
Contributor Author

@Mikolaytis Mikolaytis Jan 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's required to set cursor to _htmlCanvas, because setting cursor to the _inputElement is not working - because it's always display:none;


namespace Avalonia.Web.Blazor
{
public class CssCursor : ICursorImpl
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: this class is public, not internal, to allow end users to use some custom constructors that will allow to use cursors that's is not in the StandardCursorType enum values list

Copy link
Member

@maxkatz6 maxkatz6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@maxkatz6 maxkatz6 enabled auto-merge January 1, 2022 10:07
@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 0.10.999-cibuild0017635-beta. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json)

@maxkatz6 maxkatz6 merged commit ba9c0b3 into AvaloniaUI:master Jan 1, 2022
@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 0.10.999-cibuild0017637-beta. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json)

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

Successfully merging this pull request may close these issues.

4 participants