CefSharp
CefSharp copied to clipboard
WPF - Fixed Html Dropdown positioning when near bottom of screen
Fixes: #2820
Summary: Fixed positioning in order to prevent html dropdown to go off screen when its near the bottom of a page.
Changes: Added mouse-teleport-class in order to reset the position of a dropdown, used in chromium-web-browser.
How Has This Been Tested?
The assemblies are able to build. The example of the solution worked. The example that was pointed out in issue 2820 worked.
Types of changes
- [x ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Updated documentation
Checklist:
- [x ] Tested the code (if applicable)
- [x] Commented my code
- [ ] Changed the documentation (if applicable)
- [ ] New files have a license disclaimer
- [x ] The formatting is consistent with the project (project supports .editorconfig)
Big thanks to "carrierdown". He provied the solution a few month ago, but it was never merged as a pull request.
:x: Build CefSharp 119.1.20-CI4882 failed (commit https://github.com/cefsharp/CefSharp/commit/71ad0f9ffa by @)
- Commented my code
New class needs to be commented.
@amaitland
This will need some major refactoring before it can be considered for merge.
🢂 Thank you so much for reviewing the PR! Your comments were very helpful and I tried my best to change the code accordingly. I hope the PR gets closer to being considered for merge.
New class needs to be commented.
🢂 Done.
:white_check_mark: Build CefSharp 119.1.20-CI4886 completed (commit https://github.com/cefsharp/CefSharp/commit/02e48b840b by @)
:white_check_mark: Build CefSharp 120.1.80-CI4901 completed (commit https://github.com/cefsharp/CefSharp/commit/ac0262f4e8 by @)
:white_check_mark: Build CefSharp 120.1.80-CI4908 completed (commit https://github.com/cefsharp/CefSharp/commit/6803ebc7d8 by @)
:white_check_mark: Build CefSharp 120.1.80-CI4909 completed (commit https://github.com/cefsharp/CefSharp/commit/c4e6d341f1 by @)
:white_check_mark: Build CefSharp 120.1.80-CI4923 completed (commit https://github.com/cefsharp/CefSharp/commit/a2d5222d31 by @)
:white_check_mark: Build CefSharp 120.1.80-CI4930 completed (commit https://github.com/cefsharp/CefSharp/commit/d78ecf02be by @DidiDerDenker)
@amaitland How do we continue from here? I updated this branch and all comments are solved as far as I know.
The changes need testing. As there's currently no unit tests for the new class, it may be a take some time to validate this.
You can see if anyone subscribed to #2820 is prepared to test and report back.
As nobody has volunteered to test this we can look at including it as an opt in feature.
- Extract interface
- Add two implementations one that does nothing and one that performs the transform.
- Allow for opting in to using the new implementation.
As nobody has volunteered to test this we can look at including it as an opt in feature.
- Extract interface
- Add two implementations one that does nothing and one that performs the transform.
- Allow for opting in to using the new implementation.
@amaitland Thank you! I extraced an interface and added an implementation that doesn't adjust anything. I'm not sure how to implement the "opt-in". I added prototypical code in the constructor of "ChromiumWebBrowser". Could you give me an advice on where and how to implement the "opt-in" in the best way? Thanks :)
:x: Build CefSharp 121.3.70-CI4942 failed (commit https://github.com/cefsharp/CefSharp/commit/a40dbed132 by @)
Thanks for all the hard work. This has been merged, with follow up changes from PR #4759
You can enable the transform via an extension method:
using CefSharp.Wpf.Experimental;
chromiumWebBrowser.UsePopupMouseTransform();
Once this has been tested sufficently we can remove the method and enable it by default.
@amaitland Great, thank you! Thanks for your help as well. In which version is it going to be released?
Next major version (M123
).
Hopefully released in about a week.