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

feat: LimitedInput component WIP #134

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ndv99
Copy link
Collaborator

@ndv99 ndv99 commented Apr 30, 2024

Done

  • Created "LimitedInput" component

QA steps

  • Ensure the component is displayed correctly across all breakpoints
  • Ensure the immutableText cannot be modified by typing in the input field
  • Ensure the input still works as intended
  • Ensure the element positioning is still correct when a label is not present

Screenshots

image

@ndv99 ndv99 requested a review from Jay-Topher April 30, 2024 10:23
@webteam-app
Copy link
Collaborator

Comment on lines +12 to +13
content: var(--immutable, "");
top: var(--top, "inherit");
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm aware that this isn't a perfect solution, but for now it's workable as advised by @petermakowski. I'll create a jira ticket to investigate this implementation and find something better, but for now this should unblock canonical/maas-ui#5420

@ndv99
Copy link
Collaborator Author

ndv99 commented Apr 30, 2024

I've discovered a bug when using this in maas-ui where the immutableText only shows up in the form after one of the fields has been focused and blurred. Investigating now

@ndv99
Copy link
Collaborator Author

ndv99 commented Apr 30, 2024

I've discovered a bug when using this in maas-ui where the immutableText only shows up in the form after one of the fields has been focused and blurred. Investigating now

I've fixed this now, which also fixed the immutable text not showing in the component docs.

@ndv99 ndv99 marked this pull request as draft May 3, 2024 10:37
@ndv99 ndv99 changed the title feat: LimitedInput component feat: LimitedInput component WIP May 3, 2024
@ndv99
Copy link
Collaborator Author

ndv99 commented May 3, 2024

There's some visual issues that only occur when viewing this component in storybook that can't be replicated if this component is implemented directly in maas-ui. You can replicate this by maximising your browser window, and the placeholder text should seem misaligned. Opening and closing dev tools also causes misalignment, and importing this component into maas-ui also causes the immutableText to not register on first render.

For now, I'm implementing this component directly in maas-ui, but I've created a jira ticket to eventually upstream it to maas-react-components and fix these bugs. For now though, this has been blocking the reserved IPs work, so I'm putting this PR on hold

@ndv99 ndv99 removed the request for review from Jay-Topher May 3, 2024 15:58
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