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

fix(selection): selecting dynamic generated options no longer renders… #182

Merged
merged 1 commit into from
May 13, 2024

Conversation

jason-capsule42
Copy link
Member

@jason-capsule42 jason-capsule42 commented Apr 4, 2024

Alaska Airlines Pull Request

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Resolves: #178

Summary:

The previous code path inserted all auro-menuoption content as text into the trigger. This meant that when dynamically generating those options, and lit added an html content to the option body, the comment was also included as text in the trigger.

This change makes it so that we directly clone the option as HTML into the trigger so that the comment doesn't render. This change also adds a small amount of code to strip styles off the menuoption so it appears more like plain text per the design.

Type of change:

Please delete options that are not relevant.

  • New capability
  • Revision of an existing capability
  • Infrastructure change (automation, etc.)
  • Other (please elaborate)

Checklist:

  • My update follows the CONTRIBUTING guidelines of this project
  • I have performed a self-review of my own update

By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Pull Requests will be evaluated by their quality of update and whether it is consistent with the goals and values of this project. Any submission is to be considered a conversation between the submitter and the maintainers of this project and may require changes to your submission.

Thank you for your submission!

-- Auro Design System Team

@jason-capsule42 jason-capsule42 self-assigned this Apr 4, 2024
@jason-capsule42 jason-capsule42 linked an issue Apr 4, 2024 that may be closed by this pull request
@jason-capsule42 jason-capsule42 marked this pull request as ready for review April 4, 2024 15:52
@jason-capsule42 jason-capsule42 requested a review from a team as a code owner April 4, 2024 15:52
src/auro-select.js Outdated Show resolved Hide resolved
src/auro-select.js Outdated Show resolved Hide resolved
src/auro-select.js Outdated Show resolved Hide resolved
src/style.scss Show resolved Hide resolved
src/auro-select.js Outdated Show resolved Hide resolved
src/auro-select.js Outdated Show resolved Hide resolved
@blackfalcon
Copy link
Member

Please update the title of the comment header to be less than 100 characters and use the imperative tense.

src/auro-select.js Outdated Show resolved Hide resolved
@jason-capsule42 jason-capsule42 force-pushed the jbaker/fixDynamicOptions branch 3 times, most recently from 92546f1 to 27775b6 Compare May 6, 2024 15:39
@jason-capsule42 jason-capsule42 force-pushed the jbaker/fixDynamicOptions branch from 27775b6 to 191ca0a Compare May 10, 2024 17:55
blackfalcon
blackfalcon previously approved these changes May 10, 2024
Copy link
Member

@blackfalcon blackfalcon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit-picks in JSDocs, but otherwise approved.

@@ -216,27 +216,37 @@ export class AuroSelect extends LitElement {
}

/**
* Adds the value string to the trigger.
* @param {string} str - The string to display in the trigger.
* Updates the displayed value in an Auro dropdown component based on the provided option.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Updates the displayed value in an Auro dropdown component based on the provided option.
* Updates the displayed value of the select component based on the selected option.
* If option is a string, string value used in span element. If HTMLElement, the selected option is cloned and non-styling attributes are removed.

* Adds the value string to the trigger.
* @param {string} str - The string to display in the trigger.
* Updates the displayed value in an Auro dropdown component based on the provided option.
* @param {string|HTMLElement} option - The option to display. If a string, a new span element with the value string is created. If an HTMLElement, the selected option is cloned and non-styling attributes are removed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @param {string|HTMLElement} option - The option to display. If a string, a new span element with the value string is created. If an HTMLElement, the selected option is cloned and non-styling attributes are removed.
* @param {HTMLElement} option - The selected option element.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@jason-capsule42 jason-capsule42 force-pushed the jbaker/fixDynamicOptions branch from cff574e to 8cd3ab9 Compare May 13, 2024 15:34
@jason-capsule42 jason-capsule42 force-pushed the jbaker/fixDynamicOptions branch from 8cd3ab9 to 7b40b37 Compare May 13, 2024 15:43
@jason-capsule42 jason-capsule42 merged commit 2cdf964 into main May 13, 2024
5 of 6 checks passed
@jason-capsule42 jason-capsule42 deleted the jbaker/fixDynamicOptions branch May 13, 2024 15:45
blackfalcon pushed a commit that referenced this pull request May 13, 2024
## [2.10.1](v2.10.0...v2.10.1) (2024-05-13)

### Bug Fixes

* **menu:** correctly handle dynamic menus [#182](#182) ([2cdf964](2cdf964))
@blackfalcon
Copy link
Member

🎉 This PR is included in version 2.10.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@blackfalcon blackfalcon added the released Completed work has been released label May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Completed work has been released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrading from 2.8.5 causes strange UI issues
4 participants