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

[Modal,NftCard,Select,Input,]: Bug fix and feature added #983

Merged
merged 11 commits into from
Jan 3, 2023

Conversation

AbhinavMV
Copy link
Collaborator

@AbhinavMV AbhinavMV commented Dec 31, 2022


name: 'Pull request'
about: A new pull request

New Pull Request

Checklist

  • I am not disclosing a vulnerability.
  • My code is conform the code style
  • I have made corresponding changes to the documentation
  • I have updated Typescript definitions when needed

Issue Description and Solution Description

  1. Modal
  • added customize prop

Solution:
image

  1. NFTCard
  • for palm network the images are sometimes in metadata.file in api result, added fallback image if there is any issue in loading ipfs image (images don't load on palm network sometimes)

Solution: Added more conditions in image display logic

  1. Select (Beta)
  • When select menu is opened the first element has active hover style, now this is removed.
  • Reset active element hover style and menu scroll every time select is closed/opened.
  • add fixed to overlay element

Issue:
image

  1. InputNew
  • Add tabIndex={-1} to password button to avoid it on tab click.
  • sync error message for react hook form

Issue: when used with react hook form, the error message is updated after first render but its not updated in the input component
image

  1. Add new color - purple-60

@changeset-bot
Copy link

changeset-bot bot commented Dec 31, 2022

🦋 Changeset detected

Latest commit: 4958554

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@web3uikit/core Patch
@web3uikit/styles Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Dec 31, 2022

size-limit report 📦

Path Size
packages/core/dist/index.js 339.64 KB (+0.2% 🔺)
packages/icons/dist/index.es.js 131.47 KB (0%)
packages/web3/dist/index.js 1.5 MB (+0.02% 🔺)
packages/web3uikit/dist/index.js 1.95 MB (+0.05% 🔺)

@@ -167,7 +167,7 @@ const DivStyledOverlay = styled.div`
bottom: 0;
display: none;
left: 0;
position: absolute;
position: fixed;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this correct? wont the overlay be fixed to the page instead of the parent? does this casue an issue when you scroll the page?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the overlay is used to close the select menu if someone clicks outside of the select.

If absolute is used it takes the parent size which is usually not the screen size so the menu won't be closed. (checkout select component in admin playground it won't close even if clicked outside)

But if fixed is used it take up entire screen and if user clicks anywhere the select component will be closed

@@ -12,6 +12,7 @@ const VisibilityToggle: React.FC<IVisibilityToggleProps> = ({
className="input_visibility"
data-testid="test-input-icon-visibility"
onClick={() => onClick()}
tabIndex={-1}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why minus -1?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on password type input, when you click tab it focuses on the password icon to avoid this negative index is being used. (Never seen any site implement focusing on the password icon)

https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex

A negative value (usually tabindex="-1") means that the element is not reachable via sequential keyboard navigation, but could be focused with JavaScript or visually by clicking with the mouse. It's mostly useful to create accessible widgets with JavaScript.

@@ -68,7 +68,7 @@ const SelectMenuList: React.FunctionComponent<ISelectExtendedProps> = ({
if (wrapper) {
const el = wrapper.querySelector(selector);
if (el) {
el.scrollIntoView(false);
el?.scrollIntoView?.(false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i didnt know scrollIntoView was a function now, we used to do this manually. It seems well supported but there is some notes about Safari

https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the function is supported only the options parameter is not, just to be on the safer side I added optional chaining too.
I tested it on safari and it is working 👍🏻

Copy link
Contributor

@BillyG83 BillyG83 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some small questions more than comments. Also it would be nicer to break something like this into smaller MRs if possible 👍

@AbhinavMV
Copy link
Collaborator Author

yeah sorry, my bad I thought I was working on different branches but only realized that was not the case after everything was done.

Will take care in future 🙌🏻

Copy link
Contributor

@BillyG83 BillyG83 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢 Ship it!

@AbhinavMV AbhinavMV merged commit 9d59bda into master Jan 3, 2023
@AbhinavMV AbhinavMV deleted the feat/add-modal-customize branch January 3, 2023 10:43
@github-actions github-actions bot mentioned this pull request Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants