Git Product home page Git Product logo

Comments (6)

BobbyWibowo avatar BobbyWibowo commented on June 25, 2024 1

I figured it out

Discord uses <textarea/> when this option below is turned off
image

I will make a pull request containing a fix soon

from magane.

NawaNae avatar NawaNae commented on June 25, 2024 1

Thanks a lot. Then I just trun this switch on for a temporary solution.

from magane.

BobbyWibowo avatar BobbyWibowo commented on June 25, 2024

Are you still encountering this issue? We have been unable to replicate this till date, even in Canary


so I am not sure if just change this line into:

document.querySelector('[class^=textArea-]').innerText; 

It should indeed suppress the error, and may even still work as expected, however I can't entirely be sure until encountering it on my end too

from magane.

NawaNae avatar NawaNae commented on June 25, 2024

I still encountered this issue in my canary, and I find the difference between Canary, PTB and Discord.

Env

Canary 124017 (2c2001f)
BetterDiscord 1.5.3

The message sending box (textarea) are using different element to implement
image

Canary
image

PTB & Discord
image

So, canary only uses placeholder attr of textarea to show the message in message sending box (PTB and discord use div and span to show)
image

Experiment

I tried to insert a fake span in textarea using

var fakeSpan = document.createElement("span")
fakeSpan.style.display="none"
document.querySelector('[class^=textArea-]').appendChild(fakeSpan)

can solve this problem temporarily

Conclusion

I am not pretty sure whether only I meet this in Canary as @BobbyWibowo said "unable to replicate this till now, in Canary"
Although I disabled all of my plugins and themes in Canary, the Dom is still like the screenshot shown above. Hence, I think maybe the original Dom in Canary 124017 may like above.


Sorry, I miss the message that you also encountered this
"encountering it on my end too"
Therefore, it might caused by new version of canary.

Maybe there is any better discord api can tell which discord client are using, and try to fix this issue by the stuff just like if "canary" else ... ?

from magane.

BobbyWibowo avatar BobbyWibowo commented on June 25, 2024

Canary 124017 (2c2001f)

In which OS did you get this Canary build?
It might have been a temporary update to use <textarea/>

On my Windows boot, my Canary build is at Canary 124157 (ad7bbc4), and it's using <div></span></div>, just like in Discord Stable

image


Sorry, I miss the message that you also encountered this
"encountering it on my end too"
Therefore, it might caused by new version of canary.

Ah, I might have worded it wrong
I meant that I still had not encountered the issue, even in Canary, so I could not be sure if the workaround would work fine

from magane.

NawaNae avatar NawaNae commented on June 25, 2024

Canary 124017 (2c2001f)

In which OS did you get this Canary build? It might have been a temporary update to use <textarea/>

Windows 11 Home 21H2 22000.613
image

Because my Canary version num (124017) seems to be lower than yours (124157).
I just tried to reinstall Canary, and the version num became Canary 124163 (9d74307) which is bigger than 124157 as well as 124017.
Still I get textarea in message sending box
image

from magane.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.