Buttons placed with addActionButton cannot be pressed.

Game development with Board Game Arena Studio
Post Reply
User avatar
konnok3
Posts: 20
Joined: 10 May 2020, 04:29

Buttons placed with addActionButton cannot be pressed.

Post by konnok3 »

I have received a report of a bug in a cucco program I have coded, where the button cannot be pressed, and if he refreshes it with F5, it becomes possible to press it, but it happens every time.
I have coded the button as in the sample with the addActionButton method, but is there anything I should be aware of when using this method?
User avatar
RicardoRix
Posts: 2541
Joined: 29 April 2012, 23:43

Re: Buttons placed with addActionButton cannot be pressed.

Post by RicardoRix »

Is that specific to that user only, or does it occur for everyone?
Did they try a different browser (which browser/device did they use) ?

I believe the add/remove of event listeners is all handled automatically for you with the addActionButton() function, you just specify the event handler in the argument.
User avatar
tchobello
Posts: 693
Joined: 18 March 2012, 13:19

Re: Buttons placed with addActionButton cannot be pressed.

Post by tchobello »

konnok3 wrote: 15 July 2023, 19:07 I have received a report of a bug in a cucco program I have coded, where the button cannot be pressed, and if he refreshes it with F5, it becomes possible to press it, but it happens every time.
I have coded the button as in the sample with the addActionButton method, but is there anything I should be aware of when using this method?
hello,

the button is pressed but no action is launched.
Check what is launching it... a value might not be updated somewhere, especially if it works after a refresh, reading updated gamedatas.

Pay also attention to the fact that when enterting a new State, the order of execution is :
OnEnteringState (JS)
stExample (PHP)
OnUpdateActionButtons (JS)
User avatar
konnok3
Posts: 20
Joined: 10 May 2020, 04:29

Re: Buttons placed with addActionButton cannot be pressed.

Post by konnok3 »

Thanks for your reply.
I have had this happen to me once.
When I try to press the button, a caret appears like an EDITABLE FIELD and I cannot perform the operation to press the button.
Clicking F5 fixes it, but the next turn it happens again.
I suspect that the translation may have affected this, since it occurred in Japanese translation.
The addActionButton is coded as shown in the heartsla sample, and is not coded in any complicated way, which I believe is standard usage.
I am going to try to reproduce the test by specifying a color for the addActionButton.
User avatar
Victoria_La
Posts: 665
Joined: 28 December 2015, 20:55

Re: Buttons placed with addActionButton cannot be pressed.

Post by Victoria_La »

There are a lot of way to screw it up, its not possible to tell without checking the code.
Likely something to do with css or listeners. If you can reproduce it check the css of elements on the buttons and buttons itself,
and add debug log to see if you adding this button twice or adding another element with same id as button for example.
User avatar
konnok3
Posts: 20
Joined: 10 May 2020, 04:29

Re: Buttons placed with addActionButton cannot be pressed.

Post by konnok3 »

Thanks for your comment.

> its not possible to tell without checking the code.
I'm sure I'm using something wrong, but I have no experience coding web programs, so I don't know how to investigate.

I will try to look into css or listeners.
User avatar
konnok3
Posts: 20
Joined: 10 May 2020, 04:29

Re: Buttons placed with addActionButton cannot be pressed.

Post by konnok3 »

I downloaded Incan Gold as it was included on the BGA Code Sharing page and looked at the source and found that
dojo.stopEvent( event );
was being executed in the button action.
My program did not call this, so I fixed it.
I will continue to check for any other coding errors.
User avatar
konnok3
Posts: 20
Joined: 10 May 2020, 04:29

Re: Buttons placed with addActionButton cannot be pressed.

Post by konnok3 »

After trying various methods, I was able to reproduce the bug event.
When I tried to press a button, the mouse turned into a caret and I could not press it.

After reproducing the problem, I found that the problem occurred when the language was Japanese, but not when the language was English.
I will file a bug report, so please investigate.
User avatar
ufm
Posts: 2039
Joined: 06 January 2017, 08:38

Re: Buttons placed with addActionButton cannot be pressed.

Post by ufm »

It's possible that an invisible element is covering the button, blocking pressing that particular button.
I suspect discussion bubbles to be the culprits. Try adding .discussion_bubble {pointer-events: none;} in css.
User avatar
konnok3
Posts: 20
Joined: 10 May 2020, 04:29

Re: Buttons placed with addActionButton cannot be pressed.

Post by konnok3 »

Thank you ufm.
The bug where the button cannot be pressed has been fixed.
Post Reply

Return to “Developers”