Giter Club home page Giter Club logo

openmoji-for-react's Issues

SVGs cause content shifting after loading

The replaced emojis take up no space when not yet loaded. So, when they are loaded and rendered, the content jumps.

The improvement here would be to

  • reserve the needed screen estate in advance
    and/or
  • use the preinstalled emojis of the OS as a fallback-placeholder (similar to font-display: swap)

to reduce/eliminate cumulative layout shift coming from react-openmoji

replaceEmojis() doesn't work with consecutive emojis

Consecutive emojis are not replaced with SVGs whatsoever.
Separating them with any character/s (e.g. spaces, zero width spaces) makes it work fine, but emojis without any character/s in between them are not replaced.

Yarn add error

Hi, I get this error when trying to install this lib.

Probably comes from this namespace "sodipodi:docname="flag-quebec.svg"". I've seen then being produced by inkscape. @svgo removes them.

Could probably be resolved by using @svgr here : https://github.com/drinking-code/openmoji-for-react/blob/master/build/correct-dom-properties.js

[5/6] Building fresh packages...
error XXX/node_modules/react-openmoji: Command failed.
Exit code: 1
Command: node build/build.js && npx babel --presets @babel/preset-react src --out-dir lib --copy-files && node build/correct-dom-properties.js && rm -rf src
Arguments: 
Directory: node_modules/react-openmoji
Output:
SyntaxError:XXX/node_modules/react-openmoji/src/icons/1F3F4-E0063-E0061-E0071-E0063-E007F.js: Namespace tags are not supported by default. React's JSX doesn't support namespace tags. You can set `throwIfNamespace: false` to bypass this warning.
   5 |     if (!outline) {
   6 |         return (
>  7 |             <svg width={size} height={size} className="openmoji" viewBox="0 0 72 72" version="1.1" sodipodi:docname="flag-quebec.svg" xmlns="http://www.w3.org/2000/svg" ><g id="line-supplement"><path stroke-width="1.849" d="m5 40.5v14.5h26v-14.5h-26zm13.521 2.4785a0.68564 0.68564 0 0 1 0.68555 0.68555v4.8242h0.20312c0.064592-0.48327 0.2712-0.91288 0.58398-1.2344 0.36396-0.3741 0.83888-0.61685 1.3594-0.77148a0.51863 0.51863 0 0 1 0.14648-0.021484 0.51863 0.51863 0 0 1 0.49805 0.37109 0.51863 0.51863 0 0 1-0.34961 0.64453c-0.39915 0.11858-0.71132 0.29362-0.91211 0.5-0.14013 0.14403-0.21782 0.314

Text-selecting replaced emojis

It would be useful if replaced emojis could be text-selected (like normal emojis), for example to be then copied and pasted somewhere else (as the actual emoji character)

Some ZWJ sequences are not getting replaced properly

Some concatenated emojis, like ❤️‍🔥, get replaced only partly (the fire part, and the heart stays as a preinstalled emoji), and some, like 👩‍❤️‍💋‍👩, not at all.
❤️‍🔥 in particular is not supported by Openmoji, so an option for handling those situations would be appropriate.

Probably should go through the list of all recommended ZWJ sequences and make all of them work (or purposely not, if Openmoji does not have a replacement).

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.