Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting iro.ui.Box height property #142

Closed
michaelfarrelly opened this issue Nov 23, 2020 · 2 comments
Closed

Setting iro.ui.Box height property #142

michaelfarrelly opened this issue Nov 23, 2020 · 2 comments

Comments

@michaelfarrelly
Copy link

Working on a custom project where the height of the Box picker needs to be distinct from width. But the current Box Dimensions only allows setting the width property.

example:
image

Would it be possible to have the following change?

iro-core:
https://github.com/irojs/iro-core/blob/typescript/src/box.ts#L22-L29

/**
 * @desc Get the bounding dimensions of the box
 * @param props - box props
 */
export function getBoxDimensions(props: Partial<BoxOptions>) {
  const { width, padding, handleRadius } = props;
  return {
    width: width,
    height: width,
    radius: padding + handleRadius
  };
}

Suggested:

/**
 * @desc Get the bounding dimensions of the box
 * @param props - box props
 */
export function getBoxDimensions(props: Partial<BoxOptions>) {
  const { height, width, padding, handleRadius } = props;
  return {
    width: width,
    height: height ?? width,
    radius: padding + handleRadius
  };
}
@jaames
Copy link
Owner

jaames commented Nov 23, 2020

Sure, I'll add it to the next release. The property name will have to be boxHeight, though

jaames added a commit that referenced this issue Nov 24, 2020
@jaames jaames mentioned this issue Nov 24, 2020
@jaames
Copy link
Owner

jaames commented Nov 24, 2020

should be fixed in the latest release (5.3.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants