Buttons in MessageFormData are mapped in reverse order, with Button 2 appearing before Button 1 in the UI.
Partner Rank: Medium
Verification Builds: 1.21.22 / 27262419
Regression Builds: Unknown
Summary: Buttons in MessageFormData are mapped in reverse order, with Button 2 appearing before Button 1 in the UI.
Affects currently Live Content: Yes
Impact: The buttons in the UI are displayed in the wrong order, causing confusion as the selection index returned does not match the visual layout of the buttons.
Repro Steps:
- Create a MessageFormData form with two buttons.
- Set Button 1 with .button1("I am button 1") and Button 2 with .button2("I am button 2").
- Display the form and observe the order of the buttons.
- Check the index returned for the selected button.
Observed Results: Button 2 is displayed first in the UI, and Button 1 is displayed second. However, the returned selection index is 0 for Button 1 and 1 for Button 2, creating a mismatch between the button order and the selection index.
Expected Results: Button 1 should appear first and Button 2 second in the UI, aligning with the selection index returned (0 = Button 1, 1 = Button 2).
Screenshots/Videos attached: Yes https://capture.dropbox.com/sgeFdfsr5otoranN
Notes:
Example code:{{ const form = new MessageFormData();}}
form.title("Testing");
form.body("Just a test");
form.button1("I am button 1");
form.button2("I am button 2");
form
.show(options.options.player)
.then(resp => {
if (resp.canceled || resp.selection === undefined) {
return;
}
const selectedButtonIndex = resp.selection!;
console.error("You selected button index: " + selectedButtonIndex);
})
.catch(err => {});