Skip to content

Commit

Permalink
Fix primefaces#5125: Defensive handling of finding passthrough prop (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Oct 21, 2023
1 parent fde66fb commit 5ba6169
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions components/lib/componentbase/ComponentBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,11 @@ export const ComponentBase = {
const getOtherProps = (props) => ObjectUtils.getDiffProps(props, defaultProps);

const getPTValue = (obj = {}, key = '', params = {}, searchInDefaultPT = true) => {
// obj either is the passthrough options or has a .pt property.
if (obj.hasOwnProperty('pt') && obj.pt !== undefined) {
obj = obj.pt;
}

const hostName = params.hostName && ObjectUtils.toFlatCase(params.hostName);
const componentName = hostName || (params.props && params.props.__TYPE && ObjectUtils.toFlatCase(params.props.__TYPE)) || '';
const isNestedParam = /./g.test(key) && !!params[key.split('.')[0]];
Expand Down

0 comments on commit 5ba6169

Please sign in to comment.