Welcome to Codidact Meta!
Codidact Meta is the meta-discussion site for the Codidact community network and the Codidact software. Whether you have bug reports or feature requests, support questions or rule discussions that touch the whole network – this is the site for you.
TOC display problem after answer deletion
Describe the bug
After deleting an answer(s), the table of contents can still be displayed even if there are less answers than the "number of answers to trigger the TOC" and even if there is no answer to the question (in this case the
Table of Contents button is displayed but clicking it has no effect other than a slight colour change).
Steps to reproduce the behavior:
- To see an example, go to this post and click on the
Table of Contentsbutton to see that there is only one answer (it would be nice if a Mod can confirm that there is at least 1 deleted answer to this question). Another post with all answers deleted has been created at https://b.dev.codidact.org/ (feel free to play with it).
- Create a new question post.
- Add answers to this post until the
Table of Contentsbutton is displayed.
- Delete one answer (the
Table of Contentsshould still be displayed but with less answers).
- Delete all answers (the
Table of Contentsbutton is displayed but clicking it only changes the colour rather than opening a table).
Table of Contents button should be removed if, after an answer deletion, the number of remaining answers is lower than the number of answers to trigger the TOC (settable parameter).
Below an example with the linked question:
EDIT after answer: Here an example where all the answers have been deleted (accessible here), the
Table of Contents button is just set to gray after clicking on it (this is the view of the user who delete all the answers, then this user see all deleted answers but these answers are not displayed in the TOC):