question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to change container width to 100%

See original GitHub issue

My intention is to have emoji container with exactly same width as width of input element and also be responsive across all screen dimensions.However even after looking into #45 , I cannot exactly figure out if it is all i need to do to override existing style. No change in width was seen even after passing style as param.

Screenshot from 2022-07-07 01-28-48

Screenshot from 2022-07-07 01-22-51

I believe that it is because of Inline width on section element (which is 352px as in the first screenshot above) and a subsequent children (a div element which wraps all emojis) of inline width 324px.

My code :

function EmojiPicker(props) {
    const ref = useRef()

    useEffect(() => {
        new Picker({
            ...props,
            data,
            ref,
            set: 'apple',
            parent: document.querySelector('.emogipicker'),
            style: { width: '800px' }
        })
    }, [])

    return <div ref={ref} className="emoji_mart" />
}

const Emogi = ({ callback, emogibox }) => {
    const onEmojiClick = (emoji) => {
        console.log(emoji)
        callback(emoji)
    }

    return (
        <div aria-selected={emogibox} className="emogipicker">
            <EmojiPicker onEmojiSelect={onEmojiClick} />
        </div>
    )
}

export default Emogi

I have also applied few css rules for em-emoji-picker tag and that is working perfectly. But no css rule is working for its children.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:11
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
alexbakerscommented, Sep 12, 2022

width changed after added perLine={18}

I also think that the block should inherit the width and height of the parent.

1reaction
Haraldsoncommented, Nov 10, 2022

Any updates on this? Frankly I’m a little bummed out by how limited the styling options has gotten after the move to Shadow DOM and Custom Elements – the picker was perfectly customizable with React and Styled Components before, and now I can’t even make the inner container adapt its width due to CSS variables having to be predefined in order to style things…?

I’m all for upgrading to more modern technologies, but this feels premature?

Read more comments on GitHub >

github_iconTop Results From Across the Web

why my container isn't fit to 100%? [duplicate] - Stack Overflow
I think It has right width (768px) on iPad(768px x 1024px), but that isn't to fit my page. How can I solve this?...
Read more >
Full Width Containers in Limited Width Parents - CSS-Tricks
Let's say the parent container was 60% wide and centered. That means there is 20% width on either side of it. But margin...
Read more >
Qubely Row Unable to modify container - WordPress.org
I added a Qubely row and under the style tab, I don't have the ability to select Container type Full Width or Boxed...
Read more >
Set width for content inside 100% width container
Set page template to 100% width · Add a full width container · Make sure Interior Content Width is set to Site Width...
Read more >
Flutter: The Advanced Layout Rule Even Beginners Must Know
The red Container wants to be 100 × 100, but it can't, because the screen forces it to be exactly the same size...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found