Problem
When using <s-choice-list> component in a pos.product-details.action.render extension, the onChange and onInput event handlers do not fire correctly, preventing reactive state updates. This makes it impossible to use ChoiceList for conditional rendering or dynamic UI updates.
Expected Behavior
The onChange or onInput event handler should fire when a user selects a choice, allowing the component to update state and trigger re-renders.
Actual Behavior
Event handlers either:
- Never fire when a choice is selected
- Fire but
event.detail.valuesis undefined or incorrect - State updates but conditional rendering does not work properly
Steps to Reproduce
- Create a POS extension with target
pos.product-details.action.render - Add a
<s-choice-list>component with state-controlledvaluesprop - Implement
onInputoronChangehandler to update state - Use state for conditional rendering
- Build and deploy the extension
- Try to select different choices - observe that state does not update or UI does not react
Code Example
Action.jsx:
import {render} from 'preact';
import {useState} from 'preact/hooks';
function Extension() {
const [selectionType, setSelectionType] = useState('individual');
return (
<s-page heading="Test">
<s-choice-list
values={[selectionType]}
onInput={(e) => {
console.log('Event:', e);
const newType = e?.detail?.values?.[0] || selectionType;
setSelectionType(newType);
}}
>
<s-choice value="player">Player</s-choice>
<s-choice value="individual">Individual</s-choice>
<s-choice value="none">None</s-choice>
</s-choice-list>
{/* This conditional rendering does not work */}
{selectionType === 'player' && (
<s-text>Player selected</s-text>
)}
{selectionType === 'individual' && (
<s-text>Individual selected</s-text>
)}
</s-page>
);
}
export default async () => {
render(<Extension />, document.body);
};
Result:
- State never updates when selecting choices
- Console shows events are not fired or have incorrect structure
- Conditional rendering always shows the initial state (displays nothing or wrong content)
- No reactive UI updates occur
Workaround
Currently, the only workaround is to use <s-button> components with onClick handlers instead of ChoiceList, which works reliably but provides a different UX:
<s-button
variant={selectionType === 'player' ? 'primary' : 'secondary'}
onClick={() => setSelectionType('player')}
>
Player
</s-button>
Environment
- API Version: 2025-10
- Extension Type: POS UI Extension
- Target:
pos.product-details.action.render - Framework: Preact
- Component:
s-choice-list/s-choice