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(FileUpload): added event to onTextChange #8955

Merged

Conversation

wise-king-sullyman
Copy link
Contributor

What: Closes #8882

Additional issues:

@patternfly-build
Copy link
Contributor

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 ?

@@ -114,8 +114,8 @@ export const FileUploadField: React.FunctionComponent<FileUploadFieldProps> = ({

...props
}: 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
Contributor 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
Contributor 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
Contributor 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
10 checks passed
@patternfly-build
Copy link
Contributor

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 openSUSE/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 openSUSE/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 openSUSE/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
5 participants