Skip to content

Commit

Permalink
WRQ-28000: Fix VoiceControlDecorator and `PlaceholderControllerDeco…
Browse files Browse the repository at this point in the history
…rator` not to remount its children when it rendered

Enact-DCO-1.0-Signed-off-by: Juwon Jeong ([email protected])
  • Loading branch information
juwonjeong committed Jul 9, 2024
1 parent 67b7156 commit 9e893ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/ui/Placeholder/PlaceholderControllerDecorator.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const PlaceholderContext = createContext();
*/
const PlaceholderControllerDecorator = hoc(defaultConfig, (config, Wrapped) => {
const {bounds, notify, thresholdFactor} = config;
const WrappedWithRef = WithRef(Wrapped);

return class extends Component {
static displayName = 'PlaceholderControllerDecorator';
Expand Down Expand Up @@ -140,7 +141,6 @@ const PlaceholderControllerDecorator = hoc(defaultConfig, (config, Wrapped) => {

render () {
const props = Object.assign({}, this.props);
const WrappedWithRef = WithRef(Wrapped);

if (notify) props[notify] = this.handleNotify;

Expand Down
3 changes: 2 additions & 1 deletion packages/webos/speech/VoiceControlDecorator.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ import {WithRef} from '@enact/core/internal/WithRef';
* @public
*/
const VoiceControlDecorator = hoc((config, Wrapped) => {
const WithRefComponent = WithRef(Wrapped);

return class extends Component {
static displayName = 'VoiceControlDecorator';

Expand Down Expand Up @@ -91,7 +93,6 @@ const VoiceControlDecorator = hoc((config, Wrapped) => {
render () {
const props = {...this.props};
delete props.onVoice;
const WithRefComponent = WithRef(Wrapped);

return (
<WithRefComponent {...props} outermostRef={this.nodeRef} referrerName="VoiceControlDecorator" />
Expand Down

0 comments on commit 9e893ea

Please sign in to comment.