Skip to content

feat(FileUpload): added event to onTextChange#8955

Merged
tlabaj merged 2 commits intopatternfly:v5from
wise-king-sullyman:fileUploadField-onTextChange-add-event
Apr 25, 2023
Merged

feat(FileUpload): added event to onTextChange#8955
tlabaj merged 2 commits intopatternfly:v5from
wise-king-sullyman:fileUploadField-onTextChange-add-event

Conversation

@wise-king-sullyman
Copy link
Collaborator

What: Closes #8882

Additional issues:

@patternfly-build
Copy link
Collaborator

patternfly-build commented Apr 13, 2023

Copy link
Contributor

@jenny-s51 jenny-s51 left a comment

Choose a reason for hiding this comment

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

Nice, left a small comment below @wise-king-sullyman but I ran into some challenges testing with our FileUpload demos; looks like somewhere along the road to v5 our FileUpload examples broke.

Did some hunting and it seems like this bug may have been introduced with #7926 ... should we open an issue @tlabaj ?

}: FileUploadFieldProps) => {
const onTextAreaChange = (newValue: string) => {
onTextChange?.(newValue);
const onTextAreaChange = (newValue: string, event: React.ChangeEvent<HTMLTextAreaElement>) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

If we're following the convention that event is first for these functions, should the order of these parameters be swapped?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah I debated how I wanted to approach this. Since the onChange of TextArea that this gets passed into is still on the todo list of the param adding epic I went with just leaving this internal function in the order that it's in, but I could update the order here and just swap them in the onChange, either way works if you have a preference.

Copy link
Contributor

@thatblindgeye thatblindgeye left a comment

Choose a reason for hiding this comment

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

Other than the issue noted above, looks good.

@jenny-s51 is the issue you're running into the following error when trying to upload something?

TypeError for simple file upload

I'm getting that both in this PR's surge and the surge from the PR you linked where the dropzone was upgraded. In the React v5 surge things work fine for me, though.

@wise-king-sullyman
Copy link
Collaborator Author

@thatblindgeye
Copy link
Contributor

@wise-king-sullyman apparently the bookmark I had was an http which I guess that's why I wasn't seeing the error. Using the https link you commented I do run into the same error.

@wise-king-sullyman
Copy link
Collaborator Author

Ok good, so it's not a regression in this PR then.

I went to make an issue but it looks like #8969 will probably address it.

Copy link
Contributor

@thatblindgeye thatblindgeye left a comment

Choose a reason for hiding this comment

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

Since there's a followup for the bug above, ✅

@tlabaj tlabaj merged commit 3dcc493 into patternfly:v5 Apr 25, 2023
@patternfly-build
Copy link
Collaborator

Your changes have been released in:

  • @patternfly/react-code-editor@5.0.0-alpha.77
  • @patternfly/react-core@5.0.0-alpha.76
  • @patternfly/react-docs@6.0.0-alpha.83
  • demo-app-ts@5.0.0-alpha.60
  • @patternfly/react-integration@5.0.0-alpha.30
  • @patternfly/react-table@5.0.0-alpha.78

Thanks for your contribution! 🎉

@wise-king-sullyman wise-king-sullyman deleted the fileUploadField-onTextChange-add-event branch April 26, 2023 18:07
dgdavid added a commit to agama-project/agama that referenced this pull request Sep 12, 2023
To set the proper value after PatternFly 5 added the event as first arg
for these callback props.

See patternfly/patternfly-react#8955 and
patternfly/patternfly-react#8955

PR based on changes made by https://github.com/patternfly/pf-codemods/
dgdavid added a commit to agama-project/agama that referenced this pull request Sep 12, 2023
To set the proper value after PatternFly 5 added the event as first arg
for these callback props.

See patternfly/patternfly-react#8955 and
patternfly/patternfly-react#8955

Commit based on changes made by https://github.com/patternfly/pf-codemods/
dgdavid added a commit to agama-project/agama that referenced this pull request Sep 14, 2023
To set the proper value after PatternFly 5 added the event as first arg
for these callback props.

See patternfly/patternfly-react#8955 and
patternfly/patternfly-react#8955

Commit based on changes made by https://github.com/patternfly/pf-codemods/
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.

FileUploadField: change param order for onChange so event is first. Add event param as first parameter of onTextChange.

5 participants