@@ -1895,31 +1895,16 @@ export function createSelectionWithComposedRanges(
1895
1895
) : void {
1896
1896
// For shadow DOM, sync ranges and delegate to native modify
1897
1897
// Complex logic is handled at higher levels in Lexical
1898
- try {
1899
- if ( composedRanges . length > 0 && firstRange ) {
1900
- // Sync our composed ranges to the base DOM selection
1901
- const range = document . createRange ( ) ;
1902
- range . setStart (
1903
- firstRange . startContainer ,
1904
- firstRange . startOffset ,
1905
- ) ;
1906
- range . setEnd ( firstRange . endContainer , firstRange . endOffset ) ;
1907
-
1908
- target . removeAllRanges ( ) ;
1909
- target . addRange ( range ) ;
1910
-
1911
- // For Shadow DOM, delegate to native modify first, then handle manually if needed
1912
- try {
1913
- target . modify ( alter , direction , granularity ) ;
1914
- } catch ( _error ) {
1915
- // If native modify fails, we'll handle it at a higher level in Lexical
1916
- }
1917
- }
1898
+ if ( composedRanges . length > 0 && firstRange ) {
1899
+ // Sync our composed ranges to the base DOM selection
1900
+ const range = document . createRange ( ) ;
1901
+ range . setStart ( firstRange . startContainer , firstRange . startOffset ) ;
1902
+ range . setEnd ( firstRange . endContainer , firstRange . endOffset ) ;
1918
1903
1919
- // Fallback to base selection modify for non-shadow DOM cases
1920
- target . modify ( alter , direction , granularity ) ;
1921
- } catch ( _error ) {
1922
- // If anything fails, just delegate to the base selection
1904
+ target . removeAllRanges ( ) ;
1905
+ target . addRange ( range ) ;
1906
+
1907
+ // For Shadow DOM, delegate to native modify first, then handle manually if needed
1923
1908
target . modify ( alter , direction , granularity ) ;
1924
1909
}
1925
1910
} ;
0 commit comments