Coder Social home page Coder Social logo

Comments (6)

jNullj avatar jNullj commented on June 8, 2024

More findings:
I see a diff with events data when using windows on-screen keyboard and emoji shortcut (winkey+.)
With on-screen keyboard when the issue appears:
image
With the emoji picker (win+.) when there is no issue:
image

from docusaurus-openapi.

jNullj avatar jNullj commented on June 8, 2024

Found the bug!
image
We are using encodeURIComponent to convert to a URI in the api call, but encodeURIComponent does not work with the unicode format '\uD83C' that the keyboard outputs insted of the emoji itself.

This can be found in https://github.com/cloud-annotations/docusaurus-openapi/blob/main/packages/docusaurus-theme-openapi/src/theme/ApiDemoPanel/buildPostmanRequest.ts

I can make a pull request fixing this

from docusaurus-openapi.

jNullj avatar jNullj commented on June 8, 2024

Was too quick, this is not a valid unicode, i need to keep debugging

from docusaurus-openapi.

jNullj avatar jNullj commented on June 8, 2024

Ok new insight, this is probebly related to onInput event.
It appears that when i type using onInput the emoji start as non-exitsting unicode like \uD83C then the input continues and completes it into the pizza emoji.
But our code tries to use encodeURIComponent in this middle state where only partial emoji was registered by onInput

from docusaurus-openapi.

jNullj avatar jNullj commented on June 8, 2024

Confirmed using this textbox on github. I asked it to print to console the onInput event and from 1 emoji input using the keyboard i get 2 onInput events
image

Ok you learn something new everyday, those are UTF-16 Encoding for emoji

So i get that the onInput meets half an emoji from the UTF-16 emoji and sends it to encodeURIComponent which fails

Will PR today or tomorrow with a solution

from docusaurus-openapi.

bourdakos1 avatar bourdakos1 commented on June 8, 2024

Good find! Thanks for looking into this :)

from docusaurus-openapi.

Related Issues (20)

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.