You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe it should be number | { top: number, left: number, bottom: number, right: number }
Because it calculates the padding and the width inside dynamically, but I dont want to add top and bottom paddings. It should just fits the border of element, and add padding to sides to spotlight which will be calculated as you have done.
When I look the part of code, the changes seem to me like this roughly. If I have time I will create a merge request with working example, but in the mean time if you do that, It could be useful
get spotlightStyles() {
const { showSpotlight } = this.state;
const { disableScrollParentFix, spotlightClicks, spotlightPadding, styles, target } =
this.props;
const element = getElement(target);
const elementRect = getClientRect(element);
const isFixedTarget = hasPosition(element);
const top = getElementPosition(element, spotlightPadding, disableScrollParentFix);
return {
...(isLegacy() ? styles.spotlightLegacy : styles.spotlight),
height: Math.round(elementRect.height + spotlightPadding * 2), // will be changed bottom and top seperately
left: Math.round(elementRect.left - spotlightPadding), // should be calculated depends on left padding
opacity: showSpotlight ? 1 : 0,
pointerEvents: spotlightClicks ? 'none' : 'auto',
position: isFixedTarget ? 'fixed' : 'absolute',
top, // will be changed depends on top padding
transition: 'opacity 0.2s',
width: Math.round(elementRect.width + spotlightPadding * 2), // left and right will be added seperately
};
}
I could not find the solution that I need, so I decided to create new discussion. Maybe you like the idea
EDIT:
I rethink the idea. Seperating 4 different direction is maybe silly. but maybe we can seperate it like horizontal and vertical padding@gilbarbara
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, at first thanks for your effort to the library
What I want ?
I want to give spotlight padding seperately like
Maybe it should be
number | { top: number, left: number, bottom: number, right: number }
Because it calculates the padding and the width inside dynamically, but I dont want to add top and bottom paddings. It should just fits the border of element, and add padding to sides to spotlight which will be calculated as you have done.
When I look the part of code, the changes seem to me like this roughly. If I have time I will create a merge request with working example, but in the mean time if you do that, It could be useful
I could not find the solution that I need, so I decided to create new discussion. Maybe you like the idea
EDIT:
I rethink the idea. Seperating 4 different direction is maybe silly. but maybe we can seperate it like horizontal and vertical padding @gilbarbara
Beta Was this translation helpful? Give feedback.
All reactions