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

Hides path selector button with rest of path selector #3459

Closed
wants to merge 6 commits into from

Conversation

HazelGrant
Copy link
Contributor

@HazelGrant HazelGrant commented Mar 26, 2024

Fixes #3425

With the following form.yml:

form:
  - path
  - hide_path
attributes:
  path:
    widget: 'path_selector'
  hide_path:
    widget: 'select'
    options:
      - ['show path', 'show path']
      - ['hide path', 'hide path', data-hide-path: true]
Screen.Recording.2024-03-26.at.12.04.03.PM.mov

$(`#${changeId}`).parents().each(function(_i, parent) {
if(parent.classList.contains('form-group')) {
changeElement = $(parent);
return false;
Copy link
Contributor Author

@HazelGrant HazelGrant Mar 26, 2024

Choose a reason for hiding this comment

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

The problem here is that text_field is being passed a label option, which wraps the label/input HTML combination in its own div.form-group element. So far simply searching for the top .form-group parent has been easier than over-riding the wrapper_class on the text_field. ... But this isn't my favorite option. I'd rather figure out how to ensure that each widget is only wrapped in one .form-group div.

@HazelGrant HazelGrant closed this Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

data-hide does not hide the button for path_selector
2 participants