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

#6487 Missing tooltips on page, panel, and question expand/collapse #6506

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions functionalTests/designer/question-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,30 @@ test("Question adorner - collapse button in differen modes", async (t) => {
await ClientFunction(() => { window["creator"].expandCollapseButtonVisibility = "never"; })();
});

test("Question and page collapse button title", async (t) => {
await ClientFunction(() => { window["creator"].expandCollapseButtonVisibility = "always"; })();
await t.resizeWindow(1920, 1080);
const json = {
elements: [
{
type: "text",
name: "question1"
}
]
};
await setJSON(json);
await t.hover(getToolboxItemByText("Single-Line Input"));
const qCollapseButton = Selector(".svc-question__content #collapse button");
await t.expect(qCollapseButton.getAttribute("title")).eql("Collapse");
await t.click(qCollapseButton);
await t.expect(qCollapseButton.getAttribute("title")).eql("Expand");

const pCollapseButton = Selector(".svc-page__content #collapse button");
await t.expect(pCollapseButton.getAttribute("title")).eql("Collapse");
await t.click(pCollapseButton);
await t.expect(pCollapseButton.getAttribute("title")).eql("Expand");
});

test("Question adorner - do not render content when initially collapsed", async (t) => {
const json = {
elements: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ export class SurveyElementAdornerBase<T extends SurveyElement = SurveyElement> e
return {
id: "collapse",
css: "sv-action-bar-item--collapse",
locTooltipName: new ComputedUpdater<string>(() => this.collapsed ? "ed.expandTooltip" : "ed.collapseTooltip") as any,
iconName: new ComputedUpdater<string>(() => this.collapsed ? expandIcon : collapseIcon) as any,
iconSize: "auto",
action: () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/survey-creator-core/src/localization/english.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ export var enStrings = {
redo: "Redo",
undoTooltip: "Undo last change",
redoTooltip: "Redo the change",
expandTooltip: "Expand",
collapseTooltip: "Collapse",
expandAllTooltip: "Expand All",
collapseAllTooltip: "Collapse All",
zoomInTooltip: "Zoom In",
Expand Down