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

Deep override #4

Closed
fecony opened this issue Jul 21, 2024 · 3 comments
Closed

Deep override #4

fecony opened this issue Jul 21, 2024 · 3 comments

Comments

@fecony
Copy link

fecony commented Jul 21, 2024

No matter how deep DOM is, they all get swapy attributes
I have a case of showing blocks with background with style attribute that just gets overwriten by swapy
Screenshot 2024-07-22 at 00 53 29

Screen.Recording.2024-07-22.at.00.55.59.mov

code like this

<div
      className="item"
      data-swapy-item={itemId}
    >
      <div>
        <span>
          <span>
            <span>
              <span>
                <span
                  className="w-8 h-8 rounded-md bg-slate-50 inline-block"
                  style={{
                    backgroundColor: colour,
                  }}
                ></span>
              </span>
            </span>
          </span>
          {/* {colour} */}
        </span>
      </div>
    </div>

is same as this for swapy

    <div className="item" data-swapy-item={itemId}>
      <div>
        <span
          className="w-8 h-8 rounded-md bg-slate-50 inline-block"
          style={{
            backgroundColor: colour,
          }}
        ></span>
      </div>
    </div>
@TahaSh
Copy link
Owner

TahaSh commented Jul 22, 2024

@fecony Good catch! I will fix the styling override issue. However, please note that using Swapy attributes (which are actually from Veloxi) on any nested element is expected. Other than the styling override, this shouldn't be a problem. Thank you for reporting this!

@TahaSh
Copy link
Owner

TahaSh commented Jul 28, 2024

@fecony This should now be fixed in v0.1.0. Let me know if you have any questions!

@fecony
Copy link
Author

fecony commented Jul 28, 2024

@fecony This should now be fixed in v0.1.0.

Perfect!
2024-07-28 16 58 50

@fecony fecony closed this as completed Jul 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants