Skip to content

Conversation

@chrisolsen
Copy link
Collaborator

@chrisolsen chrisolsen commented May 8, 2025

Before (the change)

Steps needed to test

import { GoabBlock, GoabDatePicker, GoabFormItem, GoabInput } from "@abgov/react-components";
import { GoabDatePickerOnChangeDetail, GoabInputOnChangeDetail } from "@abgov/ui-components-common";

export const TestContent = () => {
  function onChange(event: GoabDatePickerOnChangeDetail) {
    console.log(event.value);
  }
  function inputOnChange(event: GoabInputOnChangeDetail) {
    console.log(event.value);
  }
  return (
    <GoabBlock direction="column">
      <GoabFormItem label="Without Width Input">
        <GoabInput name="item" value="" onChange={inputOnChange}></GoabInput>
      </GoabFormItem>
      <GoabFormItem label="Without Width DatePicker">
        <GoabDatePicker onChange={onChange} name="item" value={new Date(2025, 5, 4)}></GoabDatePicker>
      </GoabFormItem>
      <GoabFormItem label="100% Input">
        <GoabInput name="item" value="" width="100%" onChange={inputOnChange}></GoabInput>
      </GoabFormItem>
      <GoabFormItem label="100%">
        <GoabDatePicker onChange={onChange} width="100%" name="item" value={new Date(2025, 5, 4)}></GoabDatePicker>
      </GoabFormItem>

      <GoabFormItem label="50ch Input">
        <GoabInput name="item" value="" width="50ch" onChange={inputOnChange}></GoabInput>
      </GoabFormItem>
      <GoabFormItem label="50ch">
        <GoabDatePicker onChange={onChange} width="50ch" name="item" value={new Date(2025, 5, 4)}></GoabDatePicker>
      </GoabFormItem>


      <GoabFormItem label="200px Input">
        <GoabInput name="item" value="" width="200px" onChange={inputOnChange}></GoabInput>
      </GoabFormItem>
      <GoabFormItem label="200px">
        <GoabDatePicker onChange={onChange} width="200px" name="item" value={new Date(2025, 5, 4)}></GoabDatePicker>
      </GoabFormItem>
    </GoabBlock>
  )
}

@chrisolsen chrisolsen marked this pull request as draft May 9, 2025 19:14
@ArakTaiRoth ArakTaiRoth linked an issue May 12, 2025 that may be closed by this pull request
@chrisolsen chrisolsen marked this pull request as ready for review May 28, 2025 21:09
@chrisolsen
Copy link
Collaborator Author

This change only seems to work when using ch units. Can someone else verify this?

@chrisolsen chrisolsen requested review from syedszeeshan, twjeffery and vanessatran-ddi and removed request for twjeffery June 2, 2025 18:49
@vanessatran-ddi
Copy link
Collaborator

This change only seems to work when using ch units. Can someone else verify this?

For me ch works like input, however the % isn't.
image

I compared the same width with our goa-input and looks like the % is not correct.

@ArakTaiRoth
Copy link
Collaborator

@chrisolsen @vanessatran-ddi Issue with percentage width has been fixed. And tests have been created for testing the width property.

type="number"
on:_change={onInputChange}
width="4ch"
width="3ch"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to change the width here? I see the width sets to "4ch" because of this issue #2703, https://github.com/GovAlta/ui-components/pull/2706/files

type="number"
on:_change={onInputChange}
width="6ch"
width="5ch"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here, looks like "6ch" is a correct value, not "5ch"

@vanessatran-ddi
Copy link
Collaborator

I just have a concern about the merged issue comments above. The rest I have tested and it works well with ch, % and px, both react and angular. Since it has changes on popover, I also made a test on dropdown, app header menu and it looks good.

@chrisolsen
Copy link
Collaborator Author

@ArakTaiRoth you have conflicts

vanessatran-ddi
vanessatran-ddi previously approved these changes Jun 6, 2025
@ArakTaiRoth
Copy link
Collaborator

@chrisolsen All conflicts have been fixed

Comment on lines +360 to +367
display: block;
width: 100%;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ArakTaiRoth Why are these changes being made? If I remove them I see no change to datepicker, but with them the target within a normal popover takes up 100% of the parent
image

Copy link
Collaborator

Choose a reason for hiding this comment

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

@chrisolsen Perhaps we should talk about this. This is what I see for the Datepicker with that change:
image
And this is what I see if I change it back to what it was (display: flex):
image

That all being said, I do see the issue with popover-target becoming 100% width, so that needs to be fixed.

@chrisolsen chrisolsen force-pushed the contributions/solittlework/1813--datepicker-width branch from 967e661 to db3e504 Compare September 22, 2025 19:09
font-family: var(--goa-font-family-sans);
font: var(--goa-typography-body-m);
display: inline;
display: block;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These changes are still resulting the clickable area extending way beyond the components visual boundry.
image

@ArakTaiRoth
Copy link
Collaborator

Closing, as this PR got messed up by previous changes. A new PR for this story is incoming.

@ArakTaiRoth ArakTaiRoth deleted the contributions/solittlework/1813--datepicker-width branch November 21, 2025 00:00
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.

Date Picker: min-width and width property

5 participants