Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panel Dynamic - allow add panel description above add panel text button? #8379

Closed
y0n4 opened this issue Jun 6, 2024 · 3 comments
Closed
Labels
user issue An issue or bug reported by users
Milestone

Comments

@y0n4
Copy link

y0n4 commented Jun 6, 2024

Are you requesting a feature, reporting a bug or ask a question?

Question (possibly a feature)
Is it possible to have a "add panel" description right above the add panel button? Our panel dynamic has numerous elements, and can get very long with other nested panel dynamics, so we want to explain to our users what the button will do when they reach towards the end of the panel dynamic. That way we can address the fundamental usability of the button with a line of instructional text.

What is the current behavior?

The closest thing we can get is using descriptionTitle = "underInput"
Screenshot 2024-06-05 at 4 18 36 PM

What is the expected behavior?

Ideally we want to have a description text where the purple arrow is pointing to. And we can still keep the descriptionTitle to be under title
Screenshot 2024-06-05 at 4 21 57 PM

How would you reproduce the current behavior (if this is a bug)?

Provide the test code and the tested page URL (if applicable)

Tested page URL: https://codepen.io/y0n4/pen/ExzXNMZ?editors=0010

Test code

your_code_here

Specify your

  • browser: chrome
  • browser version: 125.0.6422.11
  • surveyjs platform (angular or react or jquery or knockout or vue): react
  • surveyjs version: 1.10.3
@JaneSjs JaneSjs self-assigned this Jun 6, 2024
@JaneSjs
Copy link
Contributor

JaneSjs commented Jun 6, 2024

Hello,
You can show a description under the panel by using the QuestionPanelDynamicModel.descriptionLocation property.

"descriptionLocation": "underInput"

However, you may wish to additionally apply the following CSS to add an indent between the description and the bottom border.

.sd-description.sd-question__description--under-input {
    padding-bottom: calc(var(--sd-base-vertical-padding));
}

View Demo
image

Please let me know if this option works for you.

@JaneSjs JaneSjs added the user issue An issue or bug reported by users label Jun 6, 2024
@JaneSjs JaneSjs removed their assignment Jun 6, 2024
@y0n4
Copy link
Author

y0n4 commented Jun 7, 2024

Hi, thanks for the response. Sorry- my question was if it's possible to have an add panel text description above the add panel text button (in this case "add vacation" button) and still retain the panely dynamic description like this image, and if not could it be considered to be put in as a feature request?
image

The answer you provided, "descriptionLocation": "underInput" is the closest thing we can do but it's not exactly what we are looking for.

@JaneSjs
Copy link
Contributor

JaneSjs commented Jun 7, 2024

Hello @y0n4,
Unfortunately, there is no option to render an additional description attached to the Add Panel button. To go simple, please consider adding some descriptive text to the "Add Panel" button's title.
If you want to add more text, consider implementing a custom IAction and render it using a custom component instead of a default Add Panel button component. To add a custom action, implement the survey.onGetPanelFooterActions function. To override the default button component, define the IAction.component property.

Please drop me a line if you have further questions.

@y0n4 y0n4 closed this as completed Aug 12, 2024
@OlgaLarina OlgaLarina added this to the v1.11.11 milestone Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user issue An issue or bug reported by users
Projects
None yet
Development

No branches or pull requests

4 participants