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.

Add a default position x,y of "center"

See original GitHub issue

Hey there,

I want to make a dialog that sizes to the elements within it but am having trouble doing that AND getting the dialog to be centered on the page.

It would be awesome if we could pass something like:

default={{x:"center", y:"center"}}

That way the dialog could be centered and that expands to fit the elements inside (up to its specified bounds).

Thanks @bokuweb !

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:9
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
nvdarekarcommented, Feb 1, 2021

Hi @bokuweb Any updates on this? Thank you!

1reaction
tnrichcommented, May 20, 2019

Hi @bokuweb So I tried updating react-rnd to version 3.3 of react-draggable but it wasn’t enough to just do that. I think because react-rnd calculates a position offset from the parent, the initial % translation from the positionOffset prop gets canceled out. You’ll need to take a look at the code I think and tinker with it a bit. I tried editing the react-rnd position offset code but was a little stumped as to how to get it to work perfectly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to center a "position: absolute" element
to center a a position:absolute attribute you need to set left:50% and margin-left: -50% of the width of the div.
Read more >
background-position - CSS: Cascading Style Sheets | MDN
The background-position CSS property sets the initial position for each background image. The position is relative to the position layer set ...
Read more >
Position and align objects in Pages on Mac
You can position free-floating objects on a page using x and y coordinates. Click an object to select it or select multiple objects....
Read more >
Add text descriptions to data points - MATLAB text
text( x , y , z , txt ) positions the text in 3-D coordinates. ... 'left' (default). Sample of left-aligned text. 'center'....
Read more >
Position · Bootstrap v5.0
(You can add more position values by adding entries to the ... in combination with the edge positioning utilities, allows you to absolute...
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