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

ItemList: Add check for empty fields #396

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

brookewp
Copy link
Contributor

@alecgeatches found that fields weren't showing for Salesforce after initiating a search.

This is because there are no results on the initial render for Salesforce. So the field value was remaining as an empty array even after searching/updating the view.

This adds a useEffect to make sure that fields are updated if there are changes.

Before After
Screenshot 2025-02-27 at 12 24 37 PM Screenshot 2025-02-27 at 12 35 44 PM

Signed-off-by: brookewp <[email protected]>
Copy link

Test this PR in WordPress Playground.

@brookewp brookewp mentioned this pull request Feb 27, 2025
@brookewp brookewp requested a review from chriszarate February 27, 2025 21:22
Copy link
Contributor

@alecgeatches alecgeatches left a comment

Choose a reason for hiding this comment

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

I've tested that this fixes the Salesforce connection case locally. Thank you!

fields: tableFields,
} ) );
}
}, [ tableFields ] );
Copy link
Member

Choose a reason for hiding this comment

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

The effect runs whenever tableFields changes. When does that happen? Or does it only run once?

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.

3 participants