JSFiddle - React, Tailwind, and code Playground

by Abhijeet Kandalkar

HTML

diff --git a/Source/core/editing/Editor.h b/Source/core/editing/Editor.h
index f3b0e85..21c433b 100644
--- a/Source/core/editing/Editor.h
+++ b/Source/core/editing/Editor.h
@@ -129,7 +129,7 @@ public:
         bool execute(const String& parameter = String(), Event* triggeringEvent = nullptr) const;
         bool execute(Event* triggeringEvent) const;
 
-        bool isSupported() const;
+        bool isSupported(bool enabled = false) const;
         bool isEnabled(Event* triggeringEvent = nullptr) const;
 
         TriState state(Event* triggeringEvent = nullptr) const;
diff --git a/Source/core/editing/EditorCommand.cpp b/Source/core/editing/EditorCommand.cpp
index 69e23ab..cdb82fd 100644
--- a/Source/core/editing/EditorCommand.cpp
+++ b/Source/core/editing/EditorCommand.cpp
@@ -1746,7 +1746,7 @@ bool Editor::Command::execute(Event* triggeringEvent) const
     return execute(String(), triggeringEvent);
 }
 
-bool Editor::Command::isSupported() const
+bool Editor::Command::isSupported(bool enabled) const
 {
     if (!m_command)
         return false;
@@ -1754,7 +1754,7 @@ bool Editor::Command::isSupported() const
     case CommandFromMenuOrKeyBinding:
         return true;
     case CommandFromDOM:
-        return m_command->isSupportedFromDOM(m_frame.get());
+        return enabled ? m_command->isSupportedFromDOM(m_frame.get()) : true;
     }
     ASSERT_NOT_REACHED();
     return false;
@@ -1762,7 +1762,7 @@ bool Editor::Command::isSupported() const
 
 bool Editor::Command::isEnabled(Event* triggeringEvent) const
 {
-    if (!isSupported() || !m_frame)
+    if (!isSupported(true) || !m_frame)
         return false;
     return m_command->isEnabled(*m_frame, triggeringEvent, m_source);
 }