question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Maybe toggleMark shouldn't expect perfect equality?

See original GitHub issue

Do you want to request a feature or report a bug?

Not sure this is a bug

What’s the current behavior?

Currently, when you use toggleMark, you need to pass the exact same object to make it work.

For example:

// Working
transform.toggleMark({ type: 'bold', data: { foo: 'bar' } })
transform.toggleMark({ type: 'bold', data: { foo: 'bar' } })

// Not working
transform.toggleMark({ type: 'bold', data: { foo: 'bar' } })
transform.toggleMark('bold')

What’s the expected behavior?

Maybe when a String is passed, we should remove all the marks of that type, no matter the other properties? Just asking, not sure if this could have side effects. If you agree, I think I can make a pull request.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
ianstormtaylorcommented, Jul 12, 2017

@YurkaninRyan yup it’s definitely possible. We could allow that kind of logic with an extra option potentially, or treat it as the default and make the extra option the strict matching maybe.

1reaction
ianstormtaylorcommented, Nov 28, 2019

As of https://github.com/ianstormtaylor/slate/pull/3093 (which was just merged), I believe this issue is no longer applicable, because a lot has changed. I’m going through and closing out any potential issues that are not out of date with the overhaul. Thanks for understanding.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remarks by President Biden in Address to a Joint Session ...
Americans always get up. Today, that's what we're doing: America is rising anew, choosing hope over fear, truth over lies, and light over ......
Read more >
Every successful relationship is successful for the same exact ...
I asked 1500 people for relationship advice, and kept getting the same answers.
Read more >
Mere Christianity - By CS Lewis Contents
Ever since I became a Christian I have thought that the best, perhaps the ... expect that all the planets were made to...
Read more >
Why Be Honest If Honesty Doesn't Pay
We bet on the rational case for trust. Economists, ethicists, and business sages had persuaded us that honesty is the best policy, but...
Read more >
AAMC MCAT Prep Physics Question Pack Solutions
So ultimately to find the number of half-lives, set two equations equal to one another. ... We said we're expecting half a wavelength,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found