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

fix(web): fix firefox selection issue #708

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

irvingoujAtDevolution
Copy link
Contributor

@irvingoujAtDevolution irvingoujAtDevolution commented Mar 19, 2025

Though I tested it a bit myself, but I'm not 100% confident in this change, would appericate someone can checkout to this branch and test it a liitle.

</label>
</div>

{#if showDebugPanel}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

debug panel is for testing

  1. if input focus is correct
  2. if ::selection selector is applied for element outside of iron-remote-gui

tabindex="0"
></canvas>
</div>
</div>
</div>

<style>
.screen-wrapper {
.iron-rdp-screen-wrapper {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

since we do not use shadow-root anymore, in order to reduce css naming conflict, we use iron-rdp prefix

Copy link
Member

Choose a reason for hiding this comment

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

I’m a bit surprised. When did we stop using a shadow-root?? Was it part of #680 ?
This sounds like a bad idea. Are things working as expected when opening multiple sessions in the same tab?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

works.multi.session.mp4

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Works for me!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I went over the code, each time a new is created, a new instance of session will be created as well. sperated in memory. From my understanding there's no need for shadow root. However, we can roll it back if you think this is not the practice we want.

Copy link
Member

Choose a reason for hiding this comment

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

Do you mean "a new instance of ironrdp_web::Session"?
I guess we are fine because we are not trying to fetch the canvas by using its HTML ID.
If it works, then it’s good enough, but my understanding is that using a shadow root is definitely a better practice for a web component.
I don’t think we should have to give prefix to our CSS classes to avoid conflicts with global style sheets… Shadow DOM is what allows proper encapsulation of custom elements.
What is the reason for going away from that in the first place?

Copy link

Coverage Report 🤖 ⚙️

Past:
Total lines: 30334
Covered lines: 19464 (64.17%)

New:
Total lines: 30334
Covered lines: 19468 (64.18%)

Diff: +0.01%

[this comment will be updated automatically]

@CBenoit
Copy link
Member

CBenoit commented Mar 20, 2025

Thank you, I’ll try on my side too.

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

Successfully merging this pull request may close these issues.

2 participants